Route same-origin API via /apnew/api to bypass ALB /api* rule.
All checks were successful
Deploy to Frontend Servers / deploy (push) Successful in 53s
All checks were successful
Deploy to Frontend Servers / deploy (push) Successful in 53s
ALB sends /api/* to an unreachable backend target group (502 on apex). Use VITE_API_PREFIX=/apnew with nginx proxy to backend-1 until the listener rule is removed. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
# Shared SPA locations. Browser calls same-origin /api/ + /uploads/ (VITE_API_URL empty).
|
||||
# Shared SPA locations. Browser calls same-origin /apnew/api/ + /uploads/ (VITE_API_PREFIX=/apnew).
|
||||
# /apnew/api/ avoids ALB listener rule that sends /api/* to an unreachable backend target group.
|
||||
# Nginx proxies internally to ark-library-backend-1 (Tailscale); Host header for backend TLS.
|
||||
gzip on;
|
||||
gzip_vary on;
|
||||
@@ -7,6 +8,9 @@ gzip_comp_level 5;
|
||||
gzip_types text/plain text/css application/javascript application/json application/xml image/svg+xml;
|
||||
gzip_min_length 256;
|
||||
|
||||
location ^~ /apnew/api/admin {
|
||||
return 404;
|
||||
}
|
||||
location ^~ /api/admin {
|
||||
return 404;
|
||||
}
|
||||
@@ -14,6 +18,20 @@ location ^~ /admin {
|
||||
return 404;
|
||||
}
|
||||
|
||||
location ^~ /apnew/api/ {
|
||||
proxy_pass https://100.93.205.19/api/;
|
||||
proxy_http_version 1.1;
|
||||
proxy_ssl_server_name on;
|
||||
proxy_set_header Host api.ark-library.com;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
client_max_body_size 512m;
|
||||
client_body_timeout 600s;
|
||||
proxy_read_timeout 600s;
|
||||
proxy_send_timeout 600s;
|
||||
}
|
||||
|
||||
location ^~ /api/ {
|
||||
proxy_pass https://100.93.205.19/api/;
|
||||
proxy_http_version 1.1;
|
||||
|
||||
Reference in New Issue
Block a user