I would like to have several rails applications behind the same domain name.<br><br>For example:<br><a href="http://my.domain.com/application_1">my.domain.com/application_1</a><br><a href="http://my.domain.com/application_2">my.domain.com/application_2</a><br>
<a href="http://my.domain.com/application_3">my.domain.com/application_3</a><br><br>These then need to be directed to the appropriate mongrel server. My current config below would work fine if I had <a href="http://application1.domain.com">application1.domain.com</a>, <a href="http://application2.domain.com">application2.domain.com</a> etc. But I can't seem to find an example of how to use the same domain with different apps.<br>
<br>Any hints would be appreciated.<br><br>My curent config:<br>
-------------------------------------------------------------------------------<br>upstream rails {<br> server <a href="http://127.0.0.1:8050">127.0.0.1:8050</a>;<br> server <a href="http://127.0.0.1:8051">127.0.0.1:8051</a>;<br>
}<br><br>#Rails App here<br>server {<br> listen 80;<br> server_name <a href="http://rails.softwyre.com">rails.softwyre.com</a>;<br> root /var/www/rails/user_management/current/;<br> index index.html index.htm;<br>
client_max_body_size 50M;<br><br> access_log /var/log/nginx/localhost.access.log;<br><br> proxy_set_header X-Real-IP $remote_addr;<br> proxy_set_header X-Forwarded_for $proxy_add_x_forwarded_for;<br> proxy_set_header Host $http_host;<br>
proxy_redirect false;<br> proxy_max_temp_file_size 0;<br><br> location / {<br> if (-f $request_filename) {<br> break;<br> }<br> if (-f $request_filename/index.html) {<br> rewrite (.*) $1/index.html break;<br>
}<br> if (-f $request_filename.html) {<br> rewrite (.*) $1.html break;<br> }<br> if (!-f $request_filename) {<br> proxy_pass <a href="http://rails">http://rails</a>;<br> break;<br>
}<br> }<br><br> # redirect server error pages to the static page /50x.html<br> #<br> error_page 500 502 503 504 /500.html;<br> location = /500.html {<br> root /var/www/rails/user_management/current/public;<br>
}<br>}<br><br>