开发者

Debugging with a passenger_base_uri problem

At the beginning I did a simple setup, because the app had to be accessed only for webservice calls.

nginx.conf looked like this:

location /pippa/ {
            root /var/www/apps/pippa/public;
            passenger_enabled on;
            rack_env production;
}

Everything was working fine, but now I have to access also some images in the assets of the project, so I need to set up the passenger_base_ur开发者_如何学Ci described in "Deploying Rails to sub URI".

In my nginx.conf I did the following:

...
location /pippa/ {
            root /var/www/apps/pippa;
            passenger_base_uri /pippa;
            passenger_enabled on;
            rack_env production;
}
...

Inside my rails app I did:

ln -s /var/www/apps/pippa/public /var/www/apps/pippa/pippa

All the assets under the public folder of the app are now reachable, but the app itself is not.

If I do a normal webservice call to the app that was working, now I get a 404 from Nginx.

I'm using Passenger 3 and nginx 1.0.


I think you should do the following :

cd /var/www/apps/pippa/public; ln -s /var/www/apps/pippa/app/assets/images .

Change the conf file as :

location /pippa/ {
        root /var/www/apps/pippa/public;
        passenger_enabled on;
        rack_env production;
        passenger_base_uri /images
 }

Remove the other softlink that you created, restart the nginx server & you should be able to access the images as http://yoursite.com/images

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜