File size: 2,535 Bytes
4d2df04
 
 
 
 
 
 
 
 
 
 
 
 
440fe7b
4d2df04
 
 
 
 
 
 
 
e1128ec
 
440fe7b
e1128ec
 
 
 
 
 
 
 
4d2df04
 
440fe7b
4d2df04
 
 
 
 
 
 
 
 
 
8f253b3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4d2df04
 
440fe7b
4d2df04
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
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;
        }
    }
}