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”
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.
Cool to know you are working on a similar setup.
I’m still working on it, but seem to have a sort-of (though slow and unreliable and not secure) proof of concept up and running.
I ran into so many issues that I am not sure again what fixed what, and probably half of these changes are not even necessary, but here are some things I see that are different than my nginx and config.toml above:
I changed the name of the url that streamlit runs on in config.toml and then added the same url in nginx
I have added the allowed-messages and health and forwarded them to the port
I also (tried to) turn of some of the CSP policies. Of course, my plan is to add this back on when this fully works
server {
listen 80;
listen [::]:80;
server_name url-that-your-service-will-run-on-example.com www.url-that-your-service-will-run-on-example.com
Hi @pim - I’m running into the same issue using an AWS ELB to direct traffic based on a URL path. Did you guys come up with a solution? @Hu-Wentao, I don’t understand how websockets are related here - these are http/2 request, but not websocket requests. Can you elaborate on your fix pls?
Thanks, Mark
Could you elaborate a bit more on how you solved this? We still have the same error. We are trying to have path based routing from a ELB to a streamlit app running on a subpath on fargate service. We still get a white screen and see a 404 error in the dev-console. We tried to do add --server.baseUrlPath=myapp, where then myapp is the subpath of our routing. e.g. url.com/myapp.
How did you do this?
Kudos to @pim ,
I got mine working behind url subpath folder. Only minor change is change config.toml as follow :
[server]
port=8501
runOnSave=true
baseUrlPath="webapp" #Change path here to same on nginx
[logger]
level="debug"
messageFormat = "%(asctime)s %(message)s"