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; } upstream tensorboard { server 127.0.0.1:6006; } 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'; } # TensorBoard location /tensorboard/ { proxy_pass http://tensorboard/; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; 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 X-Forwarded-Host $host; proxy_set_header X-Forwarded-Port $server_port; proxy_buffering off; } } }