Route all static files except HTML directly to disk or return 404
continuous-integration/drone/pr Build is passing Details

This commit is contained in:
Nick Douma 2021-11-10 22:32:28 +01:00
parent f18d63f76d
commit 71ec28b590
1 changed files with 7 additions and 2 deletions

View File

@ -69,10 +69,15 @@ http {
ssl_certificate /etc/nginx/ssl/dummy.crt;
ssl_certificate_key /etc/nginx/ssl/dummy.key;
location / {
location ~* .(txt|webmanifest|css|js|mjs|map|svg|jpg|jpeg|png|ico|ttf|woff|woff2|wav)$ {
root /usr/share/nginx/html;
try_files $uri $uri/ =404;
index index.html index.htm;
}
location / {
root /usr/share/nginx/html;
try_files $uri $uri/ /index.html;
index index.html;
}
error_page 500 502 503 504 /50x.html;