Passenger + nginx: placing the Rails application in a subdirectory

I am trying to deploy the application in a subdirectory /aunder www.myserver.com, following the instructions in the Passenger Docs here: http://www.modrails.com/documentation/Users%20guide.html#deploying_rails_to_sub_uri

This seems to work, but Rails routes now expect an extra subdirectory /a, so trying to access the root www.myserver.com/agives me a RoutingError. I tried the installation relative_url_root, but that doesn’t change anything. Do I need to add a prefix /ato each route in the routes file?

+3
source share
1 answer

... , , . .

, Nginx Apache?

, "root"... , "" :

http {   ...

server {
    listen 80;
    server_name g.local;
    root /home/bernie/development/test;  <- forgot to change this the first time I tried
    passenger_enabled on;   
    passenger_base_uri /rails; 
}

...

}

... :

alt text http://img190.imageshack.us/img190/8898/32380822.png

Nginx:

http://www.modrails.com/documentation/Users%20guide%20Nginx.html#deploying_rails_to_sub_uri

+3

Source: https://habr.com/ru/post/1731128/


All Articles