location = / и root

asv asv at pallant-mobile.ru
Tue Feb 10 15:44:45 MSK 2009


Делаю так:
server {
	listen       x.x.x.x:80;
	listen       x.x.x.x:8181;
	server_name  foo.ru;
	location = / {
		root /www/foo;
		index index.html;
	}
}
при запросе / в логе получаю:
*20 open() "/usr/local/etc/nginx/html/index.html" failed 
(2: No such file or directory), client: 79.132.107.15, server: foo.ru, 
request: "GET / HTTP/1.0", host: "foo.ru"

как видно, index.html ищется в /usr/local/etc/nginx/html/ вместо /www/foo

НО!
при этом, стоит заменить
	location = / {
на
	location / {
все начинает работать нормально: в ответ на запрос / 
отдается /www/foo/index.html

вопрос: что я делаю не так?


-- 
С уважением,
  Сергей Аверьянов


More information about the nginx-ru mailing list