From 76d4797cac064c90da19d13abe13afc4847c1ae0 Mon Sep 17 00:00:00 2001 From: Anton Afanasyev Date: Wed, 24 Jun 2026 17:50:43 +0200 Subject: [PATCH] cluster: fix url-shortener nginx fastcgi routing for s.f0xx.org Co-authored-by: Cursor --- sim/cluster0/nginx/url-shortener-port80.conf | 21 ++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/sim/cluster0/nginx/url-shortener-port80.conf b/sim/cluster0/nginx/url-shortener-port80.conf index 8fa582e..1edb812 100644 --- a/sim/cluster0/nginx/url-shortener-port80.conf +++ b/sim/cluster0/nginx/url-shortener-port80.conf @@ -1,6 +1,7 @@ # BE cluster — url-shortener vhost (Host: s.f0xx.org from FE) -# Install: include from /etc/nginx/http.d/androidcast.conf or http.d/url-shortener.conf -# Docroot: URL_SHORTENER_ROOT/public (default /var/www/url-shortener/public) +# Install: /etc/nginx/http.d/url-shortener.conf on cast01–03 +# Docroot: /var/www/url-shortener/public (deploy-ac-url-shortener.sh) +# Config: config/config.php + MariaDB (see ensure_url_shortener_prod_config.php pattern) server { listen 80; @@ -10,16 +11,24 @@ server { index index.php; location ^~ /api/ { - try_files $uri /index.php?$query_string; + include fastcgi_params; + fastcgi_pass 127.0.0.1:9000; + fastcgi_param SCRIPT_FILENAME /var/www/url-shortener/public/index.php; + fastcgi_param SCRIPT_NAME /index.php; + fastcgi_param REQUEST_URI $request_uri; } location ~ "^/[a-f0-9]{6,16}$" { - try_files $uri /index.php?$query_string; + include fastcgi_params; + fastcgi_pass 127.0.0.1:9000; + fastcgi_param SCRIPT_FILENAME /var/www/url-shortener/public/index.php; + fastcgi_param SCRIPT_NAME /index.php; + fastcgi_param REQUEST_URI $request_uri; } - location ~ \.php$ { + location = /index.php { include fastcgi_params; - fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_pass 127.0.0.1:9000; + fastcgi_param SCRIPT_FILENAME /var/www/url-shortener/public/index.php; } }