Update nginx config to route /api/qr-code/ to frontend (port 3800)
All checks were successful
Build and Push Docker Images / docker (push) Successful in 2m24s
All checks were successful
Build and Push Docker Images / docker (push) Successful in 2m24s
This commit is contained in:
parent
1bf06a2a68
commit
e76a650d4e
@ -86,6 +86,37 @@ server {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# === Next.js Frontend QR Code API ===
|
||||||
|
# NOTE: This MUST come before the general /api/ backend location block
|
||||||
|
location /api/qr-code/ {
|
||||||
|
proxy_pass http://127.0.0.1:3800;
|
||||||
|
proxy_http_version 1.1;
|
||||||
|
proxy_set_header Host $host;
|
||||||
|
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;
|
||||||
|
|
||||||
|
# CORS headers
|
||||||
|
add_header Access-Control-Allow-Origin '*' always;
|
||||||
|
add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS' always;
|
||||||
|
add_header Access-Control-Allow-Headers 'Content-Type, Authorization' always;
|
||||||
|
|
||||||
|
# API timeouts
|
||||||
|
proxy_read_timeout 120;
|
||||||
|
proxy_connect_timeout 120;
|
||||||
|
proxy_send_timeout 120;
|
||||||
|
|
||||||
|
# Handle OPTIONS for CORS preflight
|
||||||
|
if ($request_method = 'OPTIONS') {
|
||||||
|
add_header Access-Control-Allow-Origin '*';
|
||||||
|
add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS';
|
||||||
|
add_header Access-Control-Allow-Headers 'Content-Type, Authorization';
|
||||||
|
add_header Access-Control-Max-Age 1728000;
|
||||||
|
add_header Content-Length 0;
|
||||||
|
return 204;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
# === Backend API - Stripe Webhooks (specific route, no trailing slash) ===
|
# === Backend API - Stripe Webhooks (specific route, no trailing slash) ===
|
||||||
location = /api/webhooks/stripe {
|
location = /api/webhooks/stripe {
|
||||||
proxy_pass http://127.0.0.1:3801/api/webhooks/stripe;
|
proxy_pass http://127.0.0.1:3801/api/webhooks/stripe;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user