ChatDev/frontend/nginx.conf
2026-02-09 16:47:20 +01:00

33 lines
717 B
Nginx Configuration File

server {
listen 80;
server_name _;
# Serve built assets
root /usr/share/nginx/html;
index index.html;
# Proxy API
location /api/ {
proxy_pass http://backend:6400/api/;
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;
}
# Proxy WebSocket
location /ws {
proxy_pass http://backend:6400/ws;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
}
# SPA fallback
location / {
try_files $uri $uri/ /index.html;
}
}