Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Catalyst: Users

adding my_app_name to action paths

 

 

Catalyst users RSS feed   Index | Next | Previous | View Threaded


mike.glen at mindsweep

Jul 1, 2009, 8:43 AM

Post #1 of 6 (546 views)
Permalink
adding my_app_name to action paths

I'm trying to setup a catyst app to run behind nginx so that the app is
accessed at http://my.server.com/my_app_name/
I have set this up following instructions at
http://dev.catalyst.perl.org/wiki/adventcalendararticles/2008/02-catalyst_and_nginx
I can get the requests passed through to catalyst running the
http::prefork engine but I haven't found a simple way to add my_app_name
to the beginning of each action's path.

Is there a simple way to do this?

I'd like to be able to do this in the config file if possible

Thanks



_______________________________________________
List: Catalyst[at]lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst[at]lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


jshirley at gmail

Jul 1, 2009, 9:04 AM

Post #2 of 6 (520 views)
Permalink
Re: adding my_app_name to action paths [In reply to]

On Wed, Jul 1, 2009 at 8:43 AM, Mike Glen <mike.glen[at]mindsweep.net> wrote:

> I'm trying to setup a catyst app to run behind nginx so that the app is
> accessed at http://my.server.com/my_app_name/
> I have set this up following instructions at
> http://dev.catalyst.perl.org/wiki/adventcalendararticles/2008/02-catalyst_and_nginx
> I can get the requests passed through to catalyst running the http::prefork
> engine but I haven't found a simple way to add my_app_name to the beginning
> of each action's path.
>
> Is there a simple way to do this?
>
> I'd like to be able to do this in the config file if possible
>
> Thanks
>


It should happen automatically, provided you have set the
"using_frontend_proxy" option. Are you setting that correctly?

-J


mike.glen at mindsweep

Jul 2, 2009, 4:25 AM

Post #3 of 6 (503 views)
Permalink
Re: adding my_app_name to action paths [In reply to]

J. Shirley wrote:
> It should happen automatically, provided you have set the
> "using_frontend_proxy" option. Are you setting that correctly?
>
> -J
>
I have tried putting using_frontend_proxy 1 in myapp.conf and also
__PACKAGE__->config( name => 'MyApp', 'using_frontend_proxy' => 1 ) in
MyApp.pm
Neither of those seem to work. Are these the wrong way to set it?
I haven't been able to find the documentation for this

this is what i have in my nginx.conf
location /my_app/ {
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Host $http_host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

proxy_pass http://localhost:3000/;
}

thanks


_______________________________________________
List: Catalyst[at]lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst[at]lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


mike.glen at mindsweep

Jul 3, 2009, 4:15 AM

Post #4 of 6 (481 views)
Permalink
Re: adding my_app_name to action paths [In reply to]

J. Shirley wrote:
> On Wed, Jul 1, 2009 at 8:43 AM, Mike Glen <mike.glen[at]mindsweep.net
> <mailto:mike.glen[at]mindsweep.net>> wrote:
>
> I'm trying to setup a catyst app to run behind nginx so that the
> app is accessed at http://my.server.com/my_app_name/
> I have set this up following instructions at
> http://dev.catalyst.perl.org/wiki/adventcalendararticles/2008/02-catalyst_and_nginx
> I can get the requests passed through to catalyst running the
> http::prefork engine but I haven't found a simple way to add
> my_app_name to the beginning of each action's path.
>
> Is there a simple way to do this?
>
> I'd like to be able to do this in the config file if possible
>
> Thanks
>
>
>
> It should happen automatically, provided you have set the
> "using_frontend_proxy" option. Are you setting that correctly?
>
> -J
I have managed to get this to work by using the Catalyst::Plugin::Setenv
and adding SCRIPT_NAME my_app_name to the config file so that this is
used to generate the correct $c->request->base.
I don't believe this is the right way to do it though. Anyone got any
pointers?

Thanks
Mike



_______________________________________________
List: Catalyst[at]lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst[at]lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


jshirley at gmail

Jul 3, 2009, 6:34 AM

Post #5 of 6 (480 views)
Permalink
Re: adding my_app_name to action paths [In reply to]

On Fri, Jul 3, 2009 at 4:15 AM, Mike Glen <mike.glen[at]mindsweep.net> wrote:

> J. Shirley wrote:
>
> On Wed, Jul 1, 2009 at 8:43 AM, Mike Glen <mike.glen[at]mindsweep.net<mailto:
>> mike.glen[at]mindsweep.net>> wrote:
>>
>> I'm trying to setup a catyst app to run behind nginx so that the
>> app is accessed at http://my.server.com/my_app_name/
>> I have set this up following instructions at
>>
>> http://dev.catalyst.perl.org/wiki/adventcalendararticles/2008/02-catalyst_and_nginx
>> I can get the requests passed through to catalyst running the
>> http::prefork engine but I haven't found a simple way to add
>> my_app_name to the beginning of each action's path.
>>
>> Is there a simple way to do this?
>>
>> I'd like to be able to do this in the config file if possible
>>
>> Thanks
>>
>>
>> It should happen automatically, provided you have set the
>> "using_frontend_proxy" option. Are you setting that correctly?
>>
>> -J
>>
> I have managed to get this to work by using the Catalyst::Plugin::Setenv
> and adding SCRIPT_NAME my_app_name to the config file so that this is used
> to generate the correct $c->request->base.
> I don't believe this is the right way to do it though. Anyone got any
> pointers?
>
> Thanks
> Mike
>

Hi,

Sorry for no responding yesterday, had a full day. You can set the proxy
header directly, just using:

proxy_set_header SCRIPT_NAME /my_app/;

That should do the trick, but may be missing something. I have a working
config on a system that is currently sitting in an Apple store repair
facility :/

-J


mike.glen at mindsweep

Jul 3, 2009, 7:05 AM

Post #6 of 6 (482 views)
Permalink
Re: adding my_app_name to action paths [In reply to]

J. Shirley wrote:
> Sorry for no responding yesterday, had a full day. You can set the
> proxy header directly, just using:
>
> proxy_set_header SCRIPT_NAME /my_app/;
>
> That should do the trick, but may be missing something. I have a
> working config on a system that is currently sitting in an Apple store
> repair facility :/
>
> -J
>
I just tried that and SCRIPT_NAME doesn't seem to get picked up by
catalyst so guess something is still missing.
Thanks for your help with this.

Mike



_______________________________________________
List: Catalyst[at]lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst[at]lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/

Catalyst users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.