1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/grav_ynh.git synced 2024-09-03 19:16:01 +02:00

Improve nginx.conf to avoid ?q= at the end of some URLs

This commit is contained in:
tituspijean 2021-07-12 22:47:43 +02:00
parent 7b35482911
commit e08f08e1ac

View file

@ -3,10 +3,6 @@ location __PATH__/ {
alias __FINALPATH__/;
index index.php;
if (!-e $request_filename)
{
rewrite ^(.+)$ __PATH__/index.php?q=$1 last;
}
if ($scheme = http) {
rewrite ^ https://$server_name$request_uri? permanent;
}
@ -20,8 +16,11 @@ location __PATH__/ {
more_set_headers "X-Download-Options: noopen";
more_set_headers "X-Permitted-Cross-Domain-Policies: none";
location ~ [^/]\.php(/|$) {
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
# Bug in Nginx with locations and aliases (see http://stackoverflow.com/a/35102259 )
try_files $uri $uri/ __PATH__/__PATH__/index.php?$query_string;
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php/php__PHPVERSION__-fpm-__NAME__.sock;
fastcgi_index index.php;
include fastcgi_params;