On Fri, 2009-06-12 at 20:31 +0200, Szymon Polom wrote:
Also his root settings are wrong:
location /test {
root /var/www;
}
- 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.
They are wrong:
location /test {
root /var/www/test;
}
This will map the request /test/foo.html to /var/www/test/test/foo.html.
This is probably NOT what you want.
location /test {
root /var/www;
}
This will map the request /test/foo.html to /var/www/test/foo.html.
Whichever one you think is what you want, use. You can think whichever
one you want is wrong, but this is how it works. The $location is
appended to $document_root.
With that mapping, I assume that calling http://example.com/test/foobar
should try to access /var/www/test/foobar on the filesystem and not
/var/www/test/test/foobar like it does now.
Your assumption is incorrect.
What I’m trying to achieve is to move away from a vhost-configuration to
a multiple-apps/sites-configurations, e.g.
example.com/railsapp1/* would access /var/www/railsapp1 and below only,
location /railsapp1 {
root /var/www;
}
Request http://example.com/railsapp1/images/foo.gif would map
to /var/www/railsapp1/images/foo.gif
example.com/railsapp2/* would access /var/www/railsapp2 and below only,
location /railsapp2 {
root /var/www;
}
Request http://example.com/railsapp2/images/foo.gif would map
to /var/www/railsapp2/images/foo.gif
example.com/phpapp1/* would access /var/www/phpapp2 and below only,
example.com/ would access /var/www/static_html and below unless below is
one of the above mentioned “virtual” URIs.
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).
I saw the response to your query before I saw your original query. I
have no idea why that is.
Cliff