Streamlit behind reverse proxy doesn’t work when you change port
See original GitHub issueSummary
I am trying to run streamlit behind revese proxy doesn’t work when we change port in streamlit.
Type here a clear and concise description of the bug. Aim for 2-3 sentences. When change port in streamlit, and put it behind reverse proxy, front end try to use default port 8501 rather than changed port.
Steps to reproduce
First run streamlit
streamlit hello --server.port=2000
In reverse proxy, if you point to this url. I am seeing almost all calls fails. But Let me show you one example request.
When I look network, I see following request fail. healthz. Issue is, healthz is still ping at original port (8501) which is seen as following as error:
1. Request URL:
http://localhost:8501/healthz
2. Referrer Policy:
no-referrer-when-downgrade
When I copy request as cURL from browser for that request i see following:
-H 'Accept: application/json, text/plain, */*' \
-H 'Referer: http://localhost:3000/' \
-H 'User-Agent: Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Mobile Safari/537.36' \
--compressed
As you can see here, It is pointing to original port (8501) not change port 2000.
Expected behavior:
Expected behavior should be that it request should use port that is provided in cmd not original
Actual behavior:
However, it is pointing to default (original port) 8501.
Debug info
- Streamlit version: 0.63.0
- Python version: Python 3.6.9
- Using PipEnv
- OS version: Ubuntu 18.04.4 LTS
- Browser version: brave
Issue Analytics
- State:
- Created 3 years ago
- Comments:12 (4 by maintainers)
Top GitHub Comments
What reverse proxy do you use? When using nginx you need to make sure you enable websocket support like this:
So the issue is probably the reverse proxy and not streamlit.
That’s interesting @kush99993s.
My setup looks like this: