Root inside Location Block? Pitfalls says NO, Beginner’s Guide says YES

chrisrob nginx-forum at
Thu Sep 19 10:57:35 UTC 2013

Practically the first two pages I read when starting with nginx were:

which says "putting Root inside Location Block is BAD" - don't do it.


which gives this as its example of a config file:

The resulting configuration of the server block should look like this:

server {
    location / {
        root /data/www;
    location /images/ {
        root /data;

So I'm wondering which is right?


Posted at Nginx Forum:,242986,242986#msg-242986

More information about the nginx mailing list