File size: 3,043 Bytes
c90c95d
 
 
 
 
 
 
 
 
2b5e16f
ea45eb7
 
 
 
 
c90c95d
 
 
53d632d
 
f21a3a4
 
 
 
 
53d632d
 
 
c90c95d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
53d632d
 
f21a3a4
 
 
c90c95d
 
 
 
 
 
 
 
 
 
 
53d632d
 
f21a3a4
 
 
c90c95d
 
 
 
 
 
 
 
 
 
 
53d632d
 
f21a3a4
 
 
c90c95d
 
 
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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
worker_processes auto;
pid /tmp/nginx.pid;
error_log /tmp/nginx.error.log warn;

events {
    worker_connections 1024;
}

http {
    access_log /tmp/nginx.access.log;
    client_body_temp_path /tmp/nginx/body;
    proxy_temp_path /tmp/nginx/proxy;
    fastcgi_temp_path /tmp/nginx/fastcgi;
    uwsgi_temp_path /tmp/nginx/uwsgi;
    scgi_temp_path /tmp/nginx/scgi;
    include       /etc/nginx/mime.types;
    default_type  application/octet-stream;
    sendfile        on;
    
    # Increased timeouts for long-running quantum computations
    keepalive_timeout  360000s;
    proxy_connect_timeout 360000s;
    proxy_read_timeout 360000s;
    proxy_send_timeout 360000s;
    send_timeout 360000s;
    
    # Disable buffering for real-time updates
    proxy_buffering off;

    map $http_upgrade $connection_upgrade {
        default upgrade;
        ''      close;
    }

    upstream app_root {
        server 127.0.0.1:8700;
    }

    upstream app_em {
        server 127.0.0.1:8701;
    }

    upstream app_qlbm {
        server 127.0.0.1:8702;
    }

    server {
        listen 7860;
        server_name _;

        location /em/ {
            proxy_pass http://app_em/;
            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_set_header Upgrade $http_upgrade;
            proxy_set_header Connection $connection_upgrade;
            
            # Timeouts for long-running quantum simulations
            proxy_connect_timeout 360000s;
            proxy_read_timeout 360000s;
            proxy_send_timeout 360000s;
        }

        location /qlbm/ {
            proxy_pass http://app_qlbm/;
            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_set_header Upgrade $http_upgrade;
            proxy_set_header Connection $connection_upgrade;
            
            # Timeouts for long-running quantum simulations
            proxy_connect_timeout 360000s;
            proxy_read_timeout 360000s;
            proxy_send_timeout 360000s;
        }

        location / {
            proxy_pass http://app_root/;
            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_set_header Upgrade $http_upgrade;
            proxy_set_header Connection $connection_upgrade;
            
            # Timeouts for long-running operations
            proxy_connect_timeout 360000s;
            proxy_read_timeout 360000s;
            proxy_send_timeout 360000s;
        }
    }
}