woodburn/nginx.conf
Nathan Woodburn 9928f0c6a6
All checks were successful
Build Docker / CheckFiles (push) Successful in 5s
Build Docker / Build ARM Docker (push) Successful in 17s
Build Docker / Build Docker (push) Successful in 20s
nginx: Block some non content files
2023-09-30 12:53:56 +10:00

31 lines
566 B
Nginx Configuration File

server {
listen 80;
listen [::]:80;
server_name localhost;
location / {
root /usr/share/nginx/html;
index index.html index.htm;
try_files $uri $uri.html $uri/ =404;
}
location ~ /\.git {
deny all;
access_log off;
log_not_found off;
}
location ~* (nginx.conf|Dockerfile|cleanup.ps1|cleanup.bat|README.md|LICENSE.md) {
deny all;
}
# Custom 404 page
error_page 404 /404.html;
root /usr/share/nginx/html;
location = /404.html {
}
}