summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Dolgov <fox@fakecake.org>2024-09-12 04:10:15 +0000
committerAndrew Dolgov <fox@fakecake.org>2024-09-12 04:10:15 +0000
commit16dd42c3d6c24c8c0a1fc6d76d714b1bfa34c223 (patch)
tree5c3dfcbb0f29e04933133c0f3e58d7aeafc8461a
parent1fb202b258c751cb4e64bc38603c67263cc45959 (diff)
parentd91b7c339ddc468dbd4b4e3a7b5f3228044eeaf8 (diff)
Merge branch 'path_info_update' into 'master'
Enable PATH_INFO for plugins to use See merge request tt-rss/tt-rss!61
-rw-r--r--.docker/web-nginx/nginx.conf20
1 files changed, 18 insertions, 2 deletions
diff --git a/.docker/web-nginx/nginx.conf b/.docker/web-nginx/nginx.conf
index 411cbf453..94511eeb9 100644
--- a/.docker/web-nginx/nginx.conf
+++ b/.docker/web-nginx/nginx.conf
@@ -34,6 +34,7 @@ http {
rewrite ${APP_BASE}/healthz ${APP_BASE}/public.php?op=healthcheck;
+ # Regular PHP handling (without PATH_INFO)
location ~ \.php$ {
# regex to split $uri to $fastcgi_script_name and $fastcgi_path
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
@@ -41,6 +42,22 @@ http {
# Check that the PHP script exists before passing it
try_files $fastcgi_script_name =404;
+ fastcgi_index index.php;
+ include fastcgi.conf;
+
+ set $backend "${APP_UPSTREAM}:9000";
+
+ fastcgi_pass $backend;
+ }
+
+ # Allow PATH_INFO for PHP files in plugins.local directories with an /api/ sub directory to allow plugins to leverage when desired
+ location ~ /plugins\.local/.*/api/.*\.php(/|$) {
+ # regex to split $uri to $fastcgi_script_name and $fastcgi_path
+ fastcgi_split_path_info ^(.+?\.php)(/.*)$;
+
+ # Check that the PHP script exists before passing it
+ try_files $fastcgi_script_name =404;
+
# Bypass the fact that try_files resets $fastcgi_path_info
# see: http://trac.nginx.org/nginx/ticket/321
set $path_info $fastcgi_path_info;
@@ -53,10 +70,9 @@ http {
fastcgi_pass $backend;
}
-
+
location / {
try_files $uri $uri/ =404;
}
-
}
}