<font color="#333399"><font>I would avoid using alias since it's not mandatory:<br><br>server {<br> listen 80;<br> server_name ***; # I use one configuration file per domain and for specific subdomains which have special requirements<br>
root /var/www/$host;<br> index index.aaa index.bbb; # Depending on our needs<br> try_files $uri $uri/ /;<br>}<br><br>If multiple place must serve the same content, I may then use symbolic links in the file system.<br>
<br>For Rails, I can't give you advice.</font></font><br clear="all"><font size="1"><span style="color:rgb(102,102,102)">---<br>
</span><b><span style="color:rgb(102,102,102)">B. R.</span></b><span style="color:rgb(102,102,102)"></span></font><br>
<br><br><div class="gmail_quote">On Fri, May 11, 2012 at 5:38 AM, Frantisek Psotka <span dir="ltr"><<a href="mailto:lists@ruby-forum.com" target="_blank">lists@ruby-forum.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi there,<br>
<br>
I dont know if its correct in every case, but I did it like this:<br>
<br>
server {<br>
listen 80;<br>
server_name _;<br>
<br>
location /x/ {<br>
alias /somewhere/$host/;<br>
}<br>
<br>
location / {<br>
proxy_pass <a href="http://127.0.0.1:3000/" target="_blank">http://127.0.0.1:3000/</a>;<br>
proxy_redirect off;<br>
<br>
proxy_set_header Host $host;<br>
proxy_set_header X-Real-IP $remote_addr;<br>
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;<br>
}<br>
}<br>
<br>
I think you can use your favourite style instead of proxying to 3000.<br>
<br>
Thanks & suggestions are welcome.<br>
<span><font color="#888888"><br>
--<br>
Posted via <a href="http://www.ruby-forum.com/" target="_blank">http://www.ruby-forum.com/</a>.<br>
<br>
_______________________________________________<br>
nginx mailing list<br>
<a href="mailto:nginx@nginx.org" target="_blank">nginx@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx" target="_blank">http://mailman.nginx.org/mailman/listinfo/nginx</a><br>
</font></span></blockquote></div><br>