multi-domain to multiple roots & one rails-app

B.R. reallfqq-nginx at yahoo.fr
Fri May 11 16:16:12 UTC 2012


I would avoid using alias since it's not mandatory:

server {
  listen 80;
  server_name ***; # I use one configuration file per domain and for
specific subdomains which have special requirements
  root /var/www/$host;
  index index.aaa index.bbb; # Depending on our needs
  try_files $uri $uri/ /;
}

If multiple place must serve the same content, I may then use symbolic
links in the file system.

For Rails, I can't give you advice.
---
*B. R.*


On Fri, May 11, 2012 at 5:38 AM, Frantisek Psotka <lists at ruby-forum.com>wrote:

> 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/.
>
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20120511/94f74e48/attachment.html>


More information about the nginx mailing list