After some back and forth I have been able to load the javascript and css files from Streamlit.
However, the application will not load fully and displays “Please Wait”. The cause of which seems to be that 404s are returned for the get requests “/_stcore/health” and “/_stcore/allowed_message_origins”
What I have checked:
I have looked through the deployment list and found many topics that list the “please wait”, but there the causes seems to be different.
Furthermore, many of the articles about this seem to have be written when /healthz was still used, so I have not found useful pointers there.
I have also looked through many articles such as Streamlit, docker, Nginx, ssl/https - Deployment - Streamlit and Streamlit with Nginx. Configuration for Nginx and Streamlit… | by Raja CSP Raman | featurepreneur | Medium, but those all seem not to mention the (new?) /stcore/health check.
My situation:
- I am hosting on AWS EC2 (as a proof of concept, will use containers when this this works)
- I am behind a nginx proxy. This functions well for a simple flask server, and it does show the streamlit loading page, so connection to streamlit seems to work well
- I suspect it might be a SSL issue, as nginx is currently listening on port 80. In AWS I have configured the ALB to use port 443 for ssl.
Nginx relevant parts of config:
location = / {
proxy_pass http://IP:8502/;
proxy_http_version 1.1;
proxy_redirect off;
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;
}
location ^~ /static {
proxy_pass http://127.0.0.1:8502/static/;
}
location ^~ /vendor {
proxy_pass http://127.0.0.1:8502/vendor;
}
location ^~ /health {
proxy_pass http://127.0.0.1:8502/_stcore/health;
}
Here is config.toml
[server]
port=8502
headless=true
enableCORS=false
enableXsrfProtection=false
enableWebsocketCompression=false
[browser]
serverPort = 443
Streamlit, version 1.18.1
This seems to work for the static folder, but not for the health check (and allowed_messages_origins)
Does anyone have an idea / pointer on how to resolve this?
Any help or ideas would be much appreciated!