42 lines
1.4 KiB
Plaintext
42 lines
1.4 KiB
Plaintext
server {
|
|
listen 80;
|
|
root /usr/share/nginx/html;
|
|
index index.html;
|
|
|
|
# Proxy /api/* → kua-mail container on internal Docker network (strip /api prefix)
|
|
location /api/ {
|
|
proxy_pass http://kua-mail:3800/;
|
|
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 Authorization "Bearer ${KUA_MAIL_ADMIN_TOKEN}";
|
|
proxy_buffering off;
|
|
proxy_read_timeout 600s;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Connection '';
|
|
}
|
|
|
|
# Proxy /events → kua-mail SSE endpoint
|
|
location /events {
|
|
proxy_pass http://kua-mail:3800/events;
|
|
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 Authorization "Bearer ${KUA_MAIL_ADMIN_TOKEN}";
|
|
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;
|
|
}
|