From fc36abfa4cb324d383ccf877d3fd7012eb0c1fea Mon Sep 17 00:00:00 2001 From: Joe Banks Date: Mon, 27 May 2024 04:32:59 +0100 Subject: Add 404 fallback for files server Previously the files server would return a HTTP 500 if a matching file was not found, since internally NGINX would fall into a redirect loop trying to locate the relevant file. This adds a final 404 fallback handler so if there is not a direct match we return an error instead of returning a HTTP 500. --- ansible/roles/nginx/files/files.pydis.wtf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ansible/roles/nginx/files/files.pydis.wtf') diff --git a/ansible/roles/nginx/files/files.pydis.wtf b/ansible/roles/nginx/files/files.pydis.wtf index eb1ba45..9d4cf68 100644 --- a/ansible/roles/nginx/files/files.pydis.wtf +++ b/ansible/roles/nginx/files/files.pydis.wtf @@ -5,6 +5,6 @@ server { root /var/www/turing; location / { - try_files $uri $uri/; + try_files $uri $uri/ =404; } } -- cgit v1.2.3