Quantcast
Channel: Nginx Forum - Nginx Mailing List - English
Viewing all articles
Browse latest Browse all 7229

Root ignored for "location = /"? (2 replies)

$
0
0
Hello,

I want the index.html file in a particular directory to only be served when the domain's root URI is requested.

Using the config

server example.com;
index index.html;
location = / {
root path/to/dir;
}

a request to example.com results in index.html in the Nginx default root "/html" directory being served.

The same thing happens with a trailing slash on the root, or when I substitute a trailing-slash alias directive.

If I use an alias directive without a trailing slash I get 403 error

directory index of "path/to/dir" is forbidden.

There are no problems if I instead use "location /".

Can anyone suggest a reason or a resolution?

Thanks.

Mark

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx

Viewing all articles
Browse latest Browse all 7229

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>