Home > Back-end >  The Streamlit app stops with "Please wait... " and then stops
The Streamlit app stops with "Please wait... " and then stops

Time:12-02

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.

enter image description here

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.

https://docs.streamlit.io/knowledge-base/deploy/remote-start#symptom-2-the-app-says-please-wait-forever

  • streamlit run my_app.py --server.enableCORS=false

  • streamlit run my_app.py --server.enableWebsocketCompression=false

CodePudding user response:

Try the following conf:

server {
    listen 80 default_server;
    server_name MY_DOMAIN_NAME;

    location / {
        proxy_pass http://127.0.0.1:8501/;
            proxy_http_version 1.1;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_set_header Host $host;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "upgrade";
            proxy_read_timeout 86400;
    }

and then, use this command line:

streamlit run my_app.py --server.port 8501 --server.baseUrlPath / --server.enableCORS false --server.enableXsrfProtection false
  • Related