-
Notifications
You must be signed in to change notification settings - Fork 1
/
nginx.conf
55 lines (45 loc) · 1.27 KB
/
nginx.conf
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
pid /tmp/nginx.pid;
worker_processes auto;
events {
worker_connections 1024;
multi_accept on;
}
http {
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
upstream streamlit {
server 127.0.0.1:8501;
}
keepalive_timeout 75s;
server {
listen 8080;
charset utf-8;
location / {
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_pass http://streamlit;
auth_basic off;
}
# Streamlit endpoints
location /static {
proxy_pass http://streamlit;
}
location /stream {
proxy_http_version 1.1;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_set_header Host $http_host;
proxy_pass http://streamlit;
}
location /healthz {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
add_header Content-Type text/plain;
return 200 'OK';
}
}
}