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.
This commit is contained in:
Marc 2022-07-29 13:59:52 +02:00 committed by GitHub
parent 2c5e73482c
commit 33f675f5fb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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;
}
}
}
}