kuamail/nginx.conf

40 lines
1.2 KiB
Nginx Configuration File

server {
listen 80;
root /usr/share/nginx/html;
index index.html;
# Proxy /api/* → backend (strip /api prefix)
location /api/ {
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 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 '';
chunked_transfer_encoding on;
}
# SPA: all other routes → index.html
location / {
try_files $uri $uri/ /index.html;
}
gzip on;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml image/svg+xml;
gzip_min_length 1024;
}