Yes. Just follow the sub-URI deployment instructions in the Phusion Passenger Nginx manual: https://www.phusionpassenger.com/library/deploy/nginx/deploy/ruby/#deploying-an-app-to-a-sub-uri-or-subdirectory
Nginx for two Rails applications - root and special subfolder
-
01-07-2023 - |
문제
Is it possible to configure Nginx + Phusion Passenger in such a way that all the paths in URL will lead to one application, but /specialpath
- to the second application?
해결책
다른 팁
Of course it is.
You need to define two different upstreams, and direct traffic to them as follows:
upstreams railsapp1 {
#ip and port of first rails app
server 127.0.0.1:8001;
}
upstreams railsapp2 {
#ip and port of second rails app
server 127.0.0.1:8002;
}
server {
server_name my.domain.com;
location /special_path {
proxy_pass http://railsapp2;
}
location / {
proxy_pass http://railsapp1;
}
}
Of course you need to make some changes to fit your configuration but this is the idea.
제휴하지 않습니다 StackOverflow