multi-domain to multiple roots & one rails-app

Frantisek Psotka lists at ruby-forum.com
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_pass http://127.0.0.1:3000/;
          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 http://www.ruby-forum.com/.



More information about the nginx mailing list