From 5de95e31804cbde8caf80cf451b116227615c352 Mon Sep 17 00:00:00 2001 From: Salamandar <6552989+Salamandar@users.noreply.github.com> Date: Tue, 23 Aug 2022 17:49:06 +0200 Subject: [PATCH 1/2] Fix Nginx configuration The rewrite -> index.php last is required for urls like https://mydomain/phpback/home/feedback, mydomain/admin/ etc. The location public, favicon.ico is required to prevent rewriting those urls. --- conf/nginx.conf | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index d9fdc4e..282ae52 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,15 +1,17 @@ #sub_path_only rewrite ^__PATH__$ __PATH__/ permanent; location __PATH__/ { - # Path to source alias __FINALPATH__/; - index index.php; + try_files $uri $uri/ index.php; + location __FINALPATH__/public {} + location __FINALPATH__/favicon.ico {} + rewrite ^(.*)$ __FINALPATH__/index.php last; + # Common parameter to increase upload size limit in conjunction with dedicated php-fpm file #client_max_body_size 50M; - - try_files $uri $uri/ index.php; + location ~ [^/]\.php(/|$) { fastcgi_split_path_info ^(.+?\.php)(/.*)$; fastcgi_pass unix:/var/run/php/php__PHPVERSION__-fpm-__NAME__.sock; From 1eb863d4d9219330fd7fdc97d00a2c3f2e284d8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?E=CC=81ric=20Gaspar?= <46165813+ericgaspar@users.noreply.github.com> Date: Fri, 24 Nov 2023 16:04:31 +0100 Subject: [PATCH 2/2] Update nginx.conf --- conf/nginx.conf | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/conf/nginx.conf b/conf/nginx.conf index 1aa912f..b18618e 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -7,12 +7,12 @@ location __PATH__/ { index index.php; try_files $uri $uri/ index.php; - location __FINALPATH__/public {} - location __FINALPATH__/favicon.ico {} - rewrite ^(.*)$ __FINALPATH__/index.php last; + location __INSTALL_DIR__/public {} + location __INSTALL_DIR__/favicon.ico {} + rewrite ^(.*)$ __INSTALL_DIR__/index.php last; # Common parameter to increase upload size limit in conjunction with dedicated php-fpm file - #client_max_body_size 50M; + client_max_body_size 50M; location ~ [^/]\.php(/|$) { fastcgi_split_path_info ^(.+?\.php)(/.*)$;