From 33f675f5fb75a809940aba7bec99a125c48b3783 Mon Sep 17 00:00:00 2001 From: Marc <980978+MarcHagen@users.noreply.github.com> Date: Fri, 29 Jul 2022 13:59:52 +0200 Subject: [PATCH] Move root out of location context We are also loading images, (like favicon.ico), these will also redirect to index.php. Side effect, this causes the CSRF to be regenerated in the session. --- docker/nginx/nginx.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker/nginx/nginx.conf b/docker/nginx/nginx.conf index 660563d..92253e3 100644 --- a/docker/nginx/nginx.conf +++ b/docker/nginx/nginx.conf @@ -29,12 +29,12 @@ http { listen [::]:80 default_server; server_name _; + root /var/www/html; location / { try_files $uri $uri/ /index.php$is_args$args; } location ~ \.php$ { - root /var/www/html; fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass php-fpm:9000; fastcgi_index index.php; @@ -46,4 +46,4 @@ http { gzip off; } } -} \ No newline at end of file +}