Problem
The app started by running streamlit run main.py
will display http://IP_ADDRESS:8501
is displayed correctly, but http://DOMAIN_NAME
stops with "Please wait… " and stops.
Environment
- Domain name already resolved with Route53
- Deploy Streamlit App on EC2 (Amazon Linux) and run
Streamlit run main.py
on Tmux - Use Nginx to convert access to port80 to port8501
Changed Nginx settings
/etc/nginx/nginx.conf
server {
listen 80; #default
listen [::]:80; #default
server_name MY_DOMAIN_NAME;
location / {
proxy_pass http://MY_IP_ADDRESS:8501;
}
root /usr/share/nginx/html; #default
What I tried
I tried the following, but it did not solve the problem.
-
streamlit run my_app.py --server.enableCORS=false
-
streamlit run my_app.py --server.enableWebsocketCompression=false
5
Answers
Try the following conf:
and then, use this command line:
If anyone is using Ambassador as their ingress to kubernetes you’ll need to allow websockets. This is explained at https://www.getambassador.io/docs/edge-stack/latest/howtos/websockets/
But, you essentially need to add the following to your Mapping
I think the only problem is Streamlit trying to open a browser, so simply add this parameter in your run command:
streamlit run my_app.py --server.headless=true
or try to change this in the config file which is you need to create:
Refer to this explanation.
Try to upgrade Streamlit code to version
1.11.1
.Refer to this link: https://discuss.streamlit.io/t/security-notice-immediately-upgrade-your-streamlit-code-to-version-1-11-1/28399:
In my case, the fix was downgrading
streamlit
fromv1.14.0
tov1.11.0
.What didn’t work:
--server.headless=true
--server.enableCORS=false
--server.enableWebsocketCompression=false
How was the app deployed? GCS using Cloud Run