If you want to map a request to /test/x to /var/www/test/x instead of /var/www/test/test/x, it sounds like you need a rewrite to remove "/test" from the request URI. There may be another way of doing this, but basically:<br>
<br>...<br>location /test {<br> root /var/www/test;<br> rewrite ^/test(.*)$ $1;<br>}<br>...<br><br>That will get rid of the "duplicate" /test in the final path nginx uses to access the filesystem. Also note that the new regular expression support in the "location" should make it easy to have a single block (like above) for many sites.<br>
<br>Nick<br><br><br><div class="gmail_quote">On Fri, Jun 12, 2009 at 1:31 PM, Szymon Polom <span dir="ltr"><<a href="mailto:sp@winterstille.net">sp@winterstille.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">Cliff Wells wrote:<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
On Fri, 2009-06-12 at 18:23 +0100, lejeczek wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
would not it be a trailing(redundant) slash in location statement? - location /test<br>
</blockquote></blockquote>
<br></div>
1. The trailing slash doesn't matter, /test looks for either a file or directory (that's what nginx's error-log says to me at least). It shouldn't be looking for /test though, it should list/process the content from the filesystem as set by the root parameter (/var/www/test).<div class="im">
<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Also his root settings are wrong:<br>
<br>
location /test {<br>
root /var/www;<br>
}<br>
</blockquote>
<br></div>
2. My root-settings are not wrong. I have many sites in /var/www and test should not be mapped to /var/www but to /var/www/test.<br>
<br>
With that mapping, I assume that calling <a href="http://example.com/test/foobar" target="_blank">http://example.com/test/foobar</a> should try to access /var/www/test/foobar on the filesystem and not /var/www/test/test/foobar like it does now.<br>
<br>
What I'm trying to achieve is to move away from a vhost-configuration to a multiple-apps/sites-configurations, e.g.<br>
<br>
<a href="http://example.com/railsapp1/*" target="_blank">example.com/railsapp1/*</a> would access /var/www/railsapp1 and below only,<br>
<a href="http://example.com/railsapp2/*" target="_blank">example.com/railsapp2/*</a> would access /var/www/railsapp2 and below only,<br>
<a href="http://example.com/phpapp1/*" target="_blank">example.com/phpapp1/*</a> would access /var/www/phpapp2 and below only,<br>
<a href="http://example.com/" target="_blank">example.com/</a> would access /var/www/static_html and below unless below is one of the above mentioned "virtual" URIs.<br>
<br>
PS: It's "awesome" how slow this mailing list is (I don't mean the response time, but the time the system managing this list takes to process an email and to deliver it out to subscribers).<br>
<br>
</blockquote></div><br>