Skip to content

Commit 13667b7

Browse files
authored
fix: add streamlit endpoints in nginx.conf (#2)
1 parent 8c952d5 commit 13667b7

File tree

1 file changed

+20
-3
lines changed

1 file changed

+20
-3
lines changed

config/nginx/nginx.conf

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
pid /tmp/nginx.pid;
22

3+
worker_processes auto;
4+
35
events {
46
worker_connections 1024;
7+
multi_accept on;
58
}
69

710
http {
@@ -10,7 +13,7 @@ http {
1013
'' close;
1114
}
1215

13-
upstream server {
16+
upstream streamlit {
1417
server 127.0.0.1:8501;
1518
}
1619

@@ -24,11 +27,25 @@ http {
2427
proxy_http_version 1.1;
2528
proxy_set_header Upgrade $http_upgrade;
2629
proxy_set_header Connection $connection_upgrade;
27-
proxy_pass http://server;
30+
proxy_pass http://streamlit;
2831
auth_basic off;
2932
}
3033

31-
location /health {
34+
# Streamlit endpoints
35+
location /static {
36+
proxy_pass http://streamlit;
37+
}
38+
39+
location /stream {
40+
proxy_http_version 1.1;
41+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
42+
proxy_set_header Upgrade $http_upgrade;
43+
proxy_set_header Connection $connection_upgrade;
44+
proxy_set_header Host $http_host;
45+
proxy_pass http://streamlit;
46+
}
47+
48+
location /healthz {
3249
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
3350
proxy_set_header Host $http_host;
3451
add_header Content-Type text/plain;

0 commit comments

Comments
 (0)