TimWindecker commited on
Commit
eba8b5c
·
verified ·
1 Parent(s): 0f98158

Update nginx.conf

Browse files
Files changed (1) hide show
  1. nginx.conf +30 -31
nginx.conf CHANGED
@@ -1,36 +1,35 @@
1
- pid /tmp/nginx.pid;
 
 
2
 
3
- events {}
4
 
5
- http {
6
- client_body_temp_path /tmp/client_temp;
7
- proxy_temp_path /tmp/proxy_temp;
8
- fastcgi_temp_path /tmp/fastcgi_temp;
9
- uwsgi_temp_path /tmp/uwsgi_temp;
10
- scgi_temp_path /tmp/scgi_temp;
11
-
12
- access_log /dev/stdout;
13
- error_log /dev/stderr;
14
-
15
- server {
16
- listen 8501;
17
-
18
- # Route /chart to FastAPI
19
- location /chart {
20
- proxy_pass http://127.0.0.1:8000/chart;
21
- proxy_http_version 1.1;
22
- proxy_set_header Connection "";
23
- proxy_set_header Host $host;
24
- }
25
 
26
- # Everything else goes to Streamlit
27
- location / {
28
- proxy_pass http://127.0.0.1:8502;
29
- proxy_set_header Connection "";
30
- proxy_set_header Host $host;
31
- proxy_set_header X-Real-IP $remote_addr;
32
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
33
- proxy_set_header X-Forwarded-Proto $scheme;
34
- }
 
 
 
 
35
  }
36
  }
 
1
+ server {
2
+ listen 8501 default_server;
3
+ listen [::]:8501 default_server;
4
 
5
+ server_name _;
6
 
7
+ # Streamlit frontend
8
+ location / {
9
+ proxy_pass http://localhost:4000;
10
+ proxy_http_version 1.1;
11
+ proxy_set_header Upgrade $http_upgrade;
12
+ proxy_set_header Connection 'upgrade';
13
+ proxy_set_header Host $host;
14
+ proxy_set_header X-Real-IP $remote_addr;
15
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
16
+ proxy_cache_bypass $http_upgrade;
17
+ proxy_read_timeout 86400;
18
+ proxy_redirect off;
19
+ }
 
 
 
 
 
 
 
20
 
21
+ # JSON API
22
+ location /chart {
23
+ rewrite ^/chart/?(.*)$ /$1 break;
24
+ proxy_pass http://localhost:3000;
25
+ proxy_http_version 1.1;
26
+ proxy_set_header Upgrade $http_upgrade;
27
+ proxy_set_header Connection 'upgrade';
28
+ proxy_set_header Host $host;
29
+ proxy_set_header X-Real-IP $remote_addr;
30
+ proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
31
+ proxy_cache_bypass $http_upgrade;
32
+ proxy_read_timeout 86400;
33
+ proxy_redirect off;
34
  }
35
  }