39 lines
1.0 KiB
Nginx Configuration File
39 lines
1.0 KiB
Nginx Configuration File
|
|
server {
|
||
|
|
listen 80;
|
||
|
|
server_name _;
|
||
|
|
root /usr/share/nginx/html;
|
||
|
|
index index.html;
|
||
|
|
|
||
|
|
# SPA fallback: serve index.html for all non-file routes
|
||
|
|
location / {
|
||
|
|
try_files $uri $uri/ /index.html;
|
||
|
|
}
|
||
|
|
|
||
|
|
# API proxy — target set via CAMELEER_API_URL env var (default: http://cameleer3-server:8081)
|
||
|
|
location /api/ {
|
||
|
|
proxy_pass ${CAMELEER_API_URL};
|
||
|
|
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;
|
||
|
|
|
||
|
|
# SSE support
|
||
|
|
proxy_buffering off;
|
||
|
|
proxy_cache off;
|
||
|
|
proxy_read_timeout 86400s;
|
||
|
|
}
|
||
|
|
|
||
|
|
# Caching for static assets
|
||
|
|
location /assets/ {
|
||
|
|
expires 1y;
|
||
|
|
add_header Cache-Control "public, immutable";
|
||
|
|
}
|
||
|
|
|
||
|
|
# Health check
|
||
|
|
location /healthz {
|
||
|
|
access_log off;
|
||
|
|
return 200 "ok\n";
|
||
|
|
add_header Content-Type text/plain;
|
||
|
|
}
|
||
|
|
}
|