multi-domain to multiple roots & one rails-app

Frantisek Psotka lists at
Fri May 11 09:38:30 UTC 2012

Hi there,

I dont know if its correct in every case, but I did it like this:

    server {
        listen 80;
        server_name _;

        location /x/ {
          alias /somewhere/$host/;

        location / {
          proxy_redirect off;

          proxy_set_header Host $host;
          proxy_set_header X-Real-IP $remote_addr;
          proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

I think you can use your favourite style instead of proxying to 3000.

Thanks & suggestions are welcome.

Posted via

More information about the nginx mailing list