From e1a77327124c2451e921169755eb1f9f79d242e2 Mon Sep 17 00:00:00 2001 From: Anton Afanasyeu Date: Sun, 12 Jul 2026 20:42:51 +0200 Subject: [PATCH] nginx: serve legacy crashes/api/heartbeat.php without 301 redirect. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Old app RA polls POST here; 301 made HttpURLConnection retry as GET โ†’ 405 on heartbeat. Co-authored-by: Cursor --- sim/cluster0/nginx/apps-port80.conf | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/sim/cluster0/nginx/apps-port80.conf b/sim/cluster0/nginx/apps-port80.conf index e9e814e..cf0bd8a 100644 --- a/sim/cluster0/nginx/apps-port80.conf +++ b/sim/cluster0/nginx/apps-port80.conf @@ -108,7 +108,16 @@ server { fastcgi_param SCRIPT_FILENAME /var/www/ac/composed/backend/public/api/upload.php; fastcgi_param SCRIPT_NAME /app/androidcast_project/issues/api/upload.php; fastcgi_param REQUEST_URI $request_uri; - client_max_body_size 4m; + client_max_body_size 16m; + } + + location = /app/androidcast_project/issues/api/ticket_attachments.php { + include fastcgi_params; + fastcgi_pass 127.0.0.1:9000; + fastcgi_param SCRIPT_FILENAME /var/www/ac/composed/backend/public/api/ticket_attachments.php; + fastcgi_param SCRIPT_NAME /app/androidcast_project/issues/api/ticket_attachments.php; + fastcgi_param REQUEST_URI $request_uri; + client_max_body_size 16m; } location ^~ /app/androidcast_project/issues/ { @@ -117,7 +126,7 @@ server { fastcgi_param SCRIPT_FILENAME /var/www/ac/composed/backend/public/index.php; fastcgi_param SCRIPT_NAME /app/androidcast_project/issues/index.php; fastcgi_param REQUEST_URI $request_uri; - client_max_body_size 4m; + client_max_body_size 16m; } # Legacy /crashes/ โ†’ 301 to /issues/ (SPEC ยง7) @@ -137,6 +146,15 @@ server { return 301 $public_scheme://$http_host/app/androidcast_project/issues/api/upload.php; } + # Legacy heartbeat โ€” serve POST in-place (301 redirect drops body; old apps poll type:ra here). + location = /app/androidcast_project/crashes/api/heartbeat.php { + include fastcgi_params; + fastcgi_pass 127.0.0.1:9000; + fastcgi_param SCRIPT_FILENAME /var/www/ac/composed/backend/public/api/heartbeat.php; + fastcgi_param SCRIPT_NAME /app/androidcast_project/issues/api/heartbeat.php; + fastcgi_param REQUEST_URI /app/androidcast_project/issues/api/heartbeat.php; + } + location ^~ /app/androidcast_project/graphs/assets/ { alias /var/www/ac/composed/backend/public/assets/; }