Hi all.
I guess I am not the first to encounter this…
I want to deploy some rails apps, using only one domain
(www.mydomain.com), so that www.mydomain.com/app1/… will be mapped to
the app1 directory,
www.mydomain.com/app2/… will be mapped to the app2 directory.
I would like to use nginx + mongrels
I couldn’t figure out how to express this in the nginx config file.
I did something like :
http {
.
.
.
cluster serving app1
upstream mongrel1 {
server 127.0.0.1:7000;
server 127.0.0.1:7001;
}
cluster serving app2
upstream mongrel2 {
server 127.0.0.1:8000;
server 127.0.0.1:8001;
}
server {
.
.
.
location /app1 {
.
.
.
proxy_pass http://mongrel_app1;
}
location /app2 {
.
.
.
proxy_pass http://mongrel_app2;
}
}
}
But this doesn’t work, I get error messages in the production.log files
because the app1 / app2 prefixes are stll there for rails to figure out.
Thanks for your help
Nadav