From a9e7cea12a5cc878b9b46093ea85409fafb10b88 Mon Sep 17 00:00:00 2001 From: Alex Tselegidis Date: Mon, 10 Jul 2023 15:18:44 +0200 Subject: [PATCH] Correct NGINX downloading files instead of showing 404 for non-existing URL routes --- docker/nginx/nginx.conf | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/docker/nginx/nginx.conf b/docker/nginx/nginx.conf index 58b4070f..508622b9 100644 --- a/docker/nginx/nginx.conf +++ b/docker/nginx/nginx.conf @@ -7,14 +7,14 @@ server { access_log /var/log/nginx/application.access.log; - root /var/www/html/.; + root /var/www/html; - index index.php; + index index.php index.html; # try to serve file directly, fallback to index.php location / { - try_files $uri $uri/ /index.php$is_args$args =404; + try_files $uri $uri/ =404; } location ~ ^.+.php { @@ -27,4 +27,8 @@ server { fastcgi_buffer_size 32k; include fastcgi_params; } + + location ~ /\.ht { + deny all; + } }