Checklist
Summary
Streamlit app is running inside a docker container behind a NGINX proxy under /dashboard/ path.
The docker container is started as follows:
docker run -d -p 49500:8080 $DOCKER_IMAGE
Where 49500 is the external port, and 8080 is the internal NGINX port.
NGINX forward all requests to http://ip:49500/dashboard/ to the Streamlit app running in the internal port 8081.
The Streamlit app is started as follows:
streamlit run script.py --server.port=8081 --server.baseUrlPath="/dashboard/" --browser.gatherUsageStats=false --theme.base="light" --server.enableCORS=false --server.enableXsrfProtection=false &
Accessing the Streamlit app using the IP address works fine e.g. http://ip:49500/dashboard/.
However, while accessing the Streamlit app using a HTTP reverse proxy does not work e.g.
https://server.domain.com:8443/cloud-automation-service/services/6/endpoints/mlops-dashboard-gui-92-6/.
Our HTTP reverse proxy forwards:
https://server.domain.com:8443/cloud-automation-service/services/6/endpoints/mlops-dashboard-gui-92-6/
to:
http://0.0.0.0:49500/dashboard/
Screenshot 01

Screenshot 02

Checking the logs from the HTTP reverse proxy it shows the Websocket was closed:
[please ignore the IP addresses and ports]
2023-01-25 17:01:02.423 [qtp1454870101-30359] DEBUG org.ow2.proactive.pca.service.proxy.websocket.PCAWebSocketFilter - PCA Proxy received WebSocket request
2023-01-25 17:01:02.496 [qtp1454870101-30359] DEBUG org.ow2.proactive.pca.service.proxy.websocket.ClientWebSocketCreator - Handling WebSocket request for PSA service [1] with target service URL [ws://server.domain.com:53179/dashboard/stream]
2023-01-25 17:01:02.498 [qtp1454870101-30359] DEBUG org.ow2.proactive.pca.service.proxy.websocket.ClientWebSocket - WebSocket Proxy got connection from client: /78.199.116.24:53056
2023-01-25 17:01:02.529 [qtp1454870101-30359] DEBUG org.ow2.proactive.pca.service.proxy.websocket.ServiceWebSocketCreator - Web Socket Upgrade Request Headers : {Origin=[https://server.domain.com:8443/], X-Forwarded-Host=[server.domain.com:8443], X-Forwarded-Proto=[https], X-Forwarded-For=[78.199.116.24, 62.210.106.13], Accept-Language=[en-US,en;q=0.9,fr;q=0.8,pt;q=0.7,de;q=0.6], Accept-Encoding=[gzip, deflate, br], X-Forwarded-Server=[62.210.106.13]}
2023-01-25 17:01:02.552 [HttpClient@45312537-31978] DEBUG org.ow2.proactive.pca.service.proxy.websocket.ServiceWebSocket - WebSocket Proxy connected to service ws://server.domain.com:53179/dashboard/stream
2023-01-25 17:01:02.552 [HttpClient@45312537-31978] DEBUG org.ow2.proactive.pca.service.proxy.websocket.ServiceWebSocket - WebSocket session: WebSocketSession[websocket=JettyListenerEventDriver[org.ow2.proactive.pca.service.proxy.websocket.ServiceWebSocket],behavior=CLIENT,connection=WebSocketClientConnection@6ad8dbba::SocketChannelEndPoint@6ee75239{l=/127.0.0.1:59568,r=server.domain.com/127.0.1.1:53179,OPEN,fill=-,flush=-,to=1/3600000}{io=0/0,kio=0,kro=1}->WebSocketClientConnection@6ad8dbba[s=ConnectionState@2be5d181[OPENING],f=Flusher@362d70c5[IDLE][queueSize=0,aggregateSize=-1,terminated=null],g=Generator[CLIENT,validating],p=Parser@1a8478b1[ExtensionStack,s=START,c=0,len=0,f=null]],remote=WebSocketRemoteEndpoint@4ea68742[batching=true],incoming=JettyListenerEventDriver[org.ow2.proactive.pca.service.proxy.websocket.ServiceWebSocket],outgoing=ExtensionStack[queueSize=0,extensions=[],incoming=org.eclipse.jetty.websocket.common.WebSocketSession,outgoing=org.eclipse.jetty.websocket.client.io.WebSocketClientConnection]]
2023-01-25 17:01:02.683 [qtp1454870101-27141] DEBUG org.ow2.proactive.pca.service.proxy.websocket.ClientWebSocket - WebSocket Proxy received a close connection request from client /78.199.116.24:53056. Code: 1006, Disconnected
2023-01-25 17:01:02.683 [qtp1454870101-27141] DEBUG org.ow2.proactive.pca.service.proxy.websocket.ServiceWebSocket - WebSocket Proxy received a close request from client server.domain.com/127.0.1.1:53179. Code: 1006, Disconnected.
Reproducible Code Example
import streamlit as st
st.write("Hello, World!")
Steps To Reproduce
No response
Expected Behavior
The expected behavior is to be able to access the Streamlit app as follows

Current Behavior
The current behavior is

Is this a regression?
Debug info
- Streamlit version: 1.11.1
- Python version: 3.8.12
- Operating System: Debian GNU/Linux 11 (bullseye)
- Browser: Chrome, Firefox
- Virtual environment: Docker
Additional Information
No response
Are you willing to submit a PR?
Checklist
Summary
Streamlit app is running inside a docker container behind a NGINX proxy under
/dashboard/path.The docker container is started as follows:
docker run -d -p 49500:8080 $DOCKER_IMAGEWhere
49500is the external port, and8080is the internal NGINX port.NGINX forward all requests to
http://ip:49500/dashboard/to the Streamlit app running in the internal port8081.The Streamlit app is started as follows:
streamlit run script.py --server.port=8081 --server.baseUrlPath="/dashboard/" --browser.gatherUsageStats=false --theme.base="light" --server.enableCORS=false --server.enableXsrfProtection=false &Accessing the Streamlit app using the IP address works fine e.g.
http://ip:49500/dashboard/.However, while accessing the Streamlit app using a HTTP reverse proxy does not work e.g.
https://server.domain.com:8443/cloud-automation-service/services/6/endpoints/mlops-dashboard-gui-92-6/.Our HTTP reverse proxy forwards:
https://server.domain.com:8443/cloud-automation-service/services/6/endpoints/mlops-dashboard-gui-92-6/to:
http://0.0.0.0:49500/dashboard/Screenshot 01
Screenshot 02
Checking the logs from the HTTP reverse proxy it shows the Websocket was closed:
[please ignore the IP addresses and ports]
Reproducible Code Example
Steps To Reproduce
No response
Expected Behavior
The expected behavior is to be able to access the Streamlit app as follows
Current Behavior
The current behavior is
Is this a regression?
Debug info
Additional Information
No response
Are you willing to submit a PR?