1
0
mirror of git://f0xx.org/ac/ac-deploy synced 2026-07-29 00:58:20 +03:00

nginx: serve legacy crashes/api/heartbeat.php without 301 redirect.

Old app RA polls POST here; 301 made HttpURLConnection retry as GET → 405 on heartbeat.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Anton Afanasyeu
2026-07-12 20:42:51 +02:00
parent c073309d8c
commit e1a7732712

View File

@@ -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/;
}