Files
boc/atm-anomaly-detection/config/nginx.conf
T

54 lines
1.3 KiB
Nginx Configuration File
Raw Normal View History

events {
worker_connections 1024;
}
http {
upstream api {
server api:8000;
}
upstream dashboard {
server dashboard:3000;
}
server {
listen 80;
# API routes
location /api/ {
proxy_pass http://api/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# WebSocket support
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
# WebSocket endpoint
location /ws/ {
proxy_pass http://api;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
# Dashboard
location / {
proxy_pass http://dashboard;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}
# Static files
location /static/ {
alias /usr/share/nginx/html/;
expires 1d;
}
}
}