Phusion Passenger Standalone with rails4 within an suburl

10 views
Skip to first unread message

Rajko Albrecht

unread,
Dec 7, 2016, 3:44:24 AM12/7/16
to Phusion Passenger Discussions
Hi,

I have a problem I can not find any hint about.

When running a rails4 application with passenger standalone eg. passenger start ----nginx-config-template nginx.conf.erb -e production all is fine.

The problem comes when trying access via suburl, ieg not "localhost:3000/" but "localhost3000:/firstapp"

RAILS_RELATIVE_URL_ROOT=/firstapp passenger start --nginx-config-template nginx.conf.erb -e production

The rails content what is rendered is fine but not the static content. This will just works when I do a

ln -s . firstapp

inside the public folder, which makes sense 'cause phusion passenger looks within /firstapp inside public


But this isn't handy and does not work out of the box on deployment.

So: Is there any trick for the nginx.conf.erb to tell passenger that stuff within /firstapp uri is located within the root of public? All I found/know about is when passenger is behind an extra nginx (or apache) with its rewrite-rules which makes no sense in this case. I tried the passenger_base_uri option in Passengerfile.json but no success and I could not create a rule for the config template which will do that.


Any hints?

Bye

R

Daniel Knoppel

unread,
Dec 7, 2016, 10:44:28 AM12/7/16
to Phusion Passenger Discussions
So: Is there any trick for the nginx.conf.erb to tell passenger that stuff within /firstapp uri is located within the root of public? All I found/know about is when passenger is behind an extra nginx (or apache) with its rewrite-rules which makes no sense in this case. I tried the passenger_base_uri option in Passengerfile.json but no success and I could not create a rule for the config template which will do that.

Reply all
Reply to author
Forward
0 new messages