问题
I have two rails apps.Now I want them deployed to
app1 /
app2 /app2/
is that possible?
I'm using passenger,nginx and rails 3.2
If that's not possible, how can I redirect "/" to "/app1"?
回答1:
upstream rails1 {
server 127.0.0.1:8000;
server 127.0.0.1:8001;
server 127.0.0.1:8002;
}
upstream rails2 {
server 127.0.0.1:7000;
server 127.0.0.1:7001;
server 127.0.0.1:7002;
}
server {
location / {
proxy_pass http://rails1;
}
location /app2 {
proxy_pass http://rails2;
}
}
http://wiki.nginx.org/HttpProxyModule
http://wiki.nginx.org/NginxHttpUpstreamModule#upstream
来源:https://stackoverflow.com/questions/9588713/how-can-i-deploy-multiple-rails-app-in-nginx-with-one-in-the-root