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:
parent
7b35482911
commit
e08f08e1ac
1 changed files with 5 additions and 6 deletions
|
@ -3,10 +3,6 @@ location __PATH__/ {
|
||||||
alias __FINALPATH__/;
|
alias __FINALPATH__/;
|
||||||
index index.php;
|
index index.php;
|
||||||
|
|
||||||
if (!-e $request_filename)
|
|
||||||
{
|
|
||||||
rewrite ^(.+)$ __PATH__/index.php?q=$1 last;
|
|
||||||
}
|
|
||||||
if ($scheme = http) {
|
if ($scheme = http) {
|
||||||
rewrite ^ https://$server_name$request_uri? permanent;
|
rewrite ^ https://$server_name$request_uri? permanent;
|
||||||
}
|
}
|
||||||
|
@ -20,8 +16,11 @@ location __PATH__/ {
|
||||||
more_set_headers "X-Download-Options: noopen";
|
more_set_headers "X-Download-Options: noopen";
|
||||||
more_set_headers "X-Permitted-Cross-Domain-Policies: none";
|
more_set_headers "X-Permitted-Cross-Domain-Policies: none";
|
||||||
|
|
||||||
location ~ [^/]\.php(/|$) {
|
# Bug in Nginx with locations and aliases (see http://stackoverflow.com/a/35102259 )
|
||||||
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
|
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_pass unix:/var/run/php/php__PHPVERSION__-fpm-__NAME__.sock;
|
||||||
fastcgi_index index.php;
|
fastcgi_index index.php;
|
||||||
include fastcgi_params;
|
include fastcgi_params;
|
||||||
|
|
Loading…
Add table
Reference in a new issue