hide .git and .gitignore, and automatically fallback to index.html

This commit is contained in:
histausse 2021-10-18 21:59:04 +02:00
parent 26c72a37cc
commit 5068c088a2
Signed by: histausse
GPG key ID: 67486F107F62E9E9

View file

@ -35,9 +35,13 @@ server {
access_log /var/log/nginx/{{ item.from }}.log; access_log /var/log/nginx/{{ item.from }}.log;
error_log /var/log/nginx/{{ item.from }}_error.log; error_log /var/log/nginx/{{ item.from }}_error.log;
location ~ /\.git {
return 404;
}
location / { location / {
root {{ item.folder }}; root {{ item.folder }};
try_files $uri $uri.html 404; try_files $uri $uri.html $uri/index.html 404;
} }
include /etc/nginx/mime.types; include /etc/nginx/mime.types;