From 052cd36085c8be09c7d5d24f180f35f2e2817e6c Mon Sep 17 00:00:00 2001 From: LordGaav Date: Wed, 10 Nov 2021 21:38:07 +0000 Subject: [PATCH] feat: properly return 404 when the file does not exist (#966) Co-authored-by: Nick Douma Reviewed-on: https://kolaente.dev/vikunja/frontend/pulls/966 Reviewed-by: konrad Co-authored-by: LordGaav Co-committed-by: LordGaav --- nginx.conf | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/nginx.conf b/nginx.conf index 1adb02b5f..6e980b238 100644 --- a/nginx.conf +++ b/nginx.conf @@ -69,10 +69,15 @@ http { ssl_certificate /etc/nginx/ssl/dummy.crt; ssl_certificate_key /etc/nginx/ssl/dummy.key; + 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; + } + location / { root /usr/share/nginx/html; - try_files $uri $uri/ /; - index index.html index.htm; + try_files $uri $uri/ /index.html; + index index.html; } error_page 500 502 503 504 /50x.html;