NGINX configuration: define "root" and "index" at server level

It's best-practice to not define these inside a "location" block
to prevent having to re-define them for each location.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2020-02-28 14:28:29 +01:00
parent a94d10bdd2
commit e73356f7cd
No known key found for this signature in database
GPG Key ID: 76698F39D527CE8C
1 changed files with 2 additions and 4 deletions

View File

@ -4,8 +4,6 @@ server {
absolute_redirect off;
listen 4000;
error_page 403 404 /404.html;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
}
root /usr/share/nginx/html;
index index.html;
}