Welcome! Log In Create A New Profile

Advanced

Location Directive help

Posted by rook2pawn 
Location Directive help
March 06, 2011 10:53PM
Hi, from my "default" configuration:
# You may add here your
# server {
# ...
# }
# statements for each of your virtual hosts

server {
listen 80;
location / {
root /var/www/nginx-default;
index index.html index.htm;
}
location /doc {
root /usr/share;
autoindex on;
allow 127.0.0.1;
deny all;
}
location /images {
root /usr/share;
autoindex on;
}
}

This works fine. However, if i add in

location /foo {
root /usr/share;
autoindex on;
}

say right beneath the /images location directive

and i restart nginx,
nginx returns a 404 on request for /foo

Is this correct or am i missing something?

Thanks
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 179
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready