fix(nginx): strip /api prefix when proxying to backend; fix /events path
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
73391e0b07
commit
57f1c1440b
19
nginx.conf
19
nginx.conf
|
|
@ -3,15 +3,26 @@ server {
|
||||||
root /usr/share/nginx/html;
|
root /usr/share/nginx/html;
|
||||||
index index.html;
|
index index.html;
|
||||||
|
|
||||||
# Proxy /api and /events to the kua-mail backend
|
# Proxy /api/* → backend (strip /api prefix)
|
||||||
location ~ ^/(api|events)(/.*)?$ {
|
location /api/ {
|
||||||
proxy_pass https://api.mail.kua.cl;
|
proxy_pass https://api.mail.kua.cl/;
|
||||||
|
proxy_set_header Host api.mail.kua.cl;
|
||||||
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
|
proxy_buffering off;
|
||||||
|
proxy_read_timeout 600s;
|
||||||
|
proxy_http_version 1.1;
|
||||||
|
proxy_set_header Connection '';
|
||||||
|
}
|
||||||
|
|
||||||
|
# Proxy /events → backend (no prefix strip)
|
||||||
|
location /events {
|
||||||
|
proxy_pass https://api.mail.kua.cl/events;
|
||||||
proxy_set_header Host api.mail.kua.cl;
|
proxy_set_header Host api.mail.kua.cl;
|
||||||
proxy_set_header X-Real-IP $remote_addr;
|
proxy_set_header X-Real-IP $remote_addr;
|
||||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||||
proxy_buffering off;
|
proxy_buffering off;
|
||||||
proxy_read_timeout 600s;
|
proxy_read_timeout 600s;
|
||||||
# SSE support
|
|
||||||
proxy_http_version 1.1;
|
proxy_http_version 1.1;
|
||||||
proxy_set_header Connection '';
|
proxy_set_header Connection '';
|
||||||
chunked_transfer_encoding on;
|
chunked_transfer_encoding on;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue