worker_processes 1; events { worker_connections 256; } http { include /etc/nginx/mime.types; default_type application/octet-stream; access_log off; server { listen 7860; # SSE – disable buffering for the dashboard's /stream endpoint location /stream { proxy_pass http://127.0.0.1:5000/stream; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_buffering off; proxy_cache off; proxy_read_timeout 3600s; chunked_transfer_encoding on; } # Frontend (order entry) – served under /frontend/ location /frontend/ { proxy_pass http://127.0.0.1:5003/; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; sub_filter 'href="/' 'href="/frontend/'; sub_filter 'action="/' 'action="/frontend/'; sub_filter_once off; proxy_redirect / /frontend/; } # FIX UI Client – served under /fix/ location /fix/ { proxy_pass http://127.0.0.1:5002/; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; # Rewrite absolute links generated by Flask url_for() sub_filter 'href="/' 'href="/fix/'; sub_filter 'action="/' 'action="/fix/'; sub_filter_once off; # Rewrite Location headers on Flask redirects proxy_redirect / /fix/; } # Clearing House SSE stream – disable buffering location /ch/stream { proxy_pass http://127.0.0.1:5004/ch/stream; proxy_set_header Host $host; proxy_buffering off; proxy_cache off; proxy_read_timeout 3600s; chunked_transfer_encoding on; } # Clearing House portal location /ch/ { proxy_pass http://127.0.0.1:5004/ch/; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_buffering off; } # Dashboard – everything else location / { proxy_pass http://127.0.0.1:5000; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_buffering off; } } }