szyab
December 4, 2023, 7:09am
1
I’m having trouble deploying my project. When accessing it with a local address, everything works fine. However, after configuring Nginx, the address is no longer accessible, and I’m getting the following error in the console:
main.5e4731c6.js:2 WebSocket connection to 'ws://testm.10jqka.com.cn/domain_test/_stcore/stream' failed:
I have spent a lot of time searching through similar posts, but none of the solutions seem to work for me. I’m feeling quite frustrated about this. Below is my Nginx configuration:
location /domain_test/ {
proxy_pass http://127.0.0.1:8501/;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Real-IP $remote_addr;
}
location /domain_test/_stcore/stream {
proxy_pass http://127.0.0.1:8501/_stcore/stream;
proxy_http_version 1.1;
proxy_set_header X-Forwarded-For $remote_addr;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Origin $host;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_set_header Host $host;
}
my streamlit version:1.22.0
I would greatly appreciate any help in resolving this issue.
Hey @szyab ,
Have you checked out these posts?
Hey there I am getting an error to connect to WSS, i think the error occurs whem promote ws to wss.
The page keeps Loading “Please wait…” and on developer tools the wss calls failed.
“WebSocket connection to ‘wss://streamlit.us.stg.xpto.cloud/_stcore/stream’ failed”
On deployment the ingress is configured to redirect to ssl.
Dear all,
I’m having troubles deploying a streamlit application: The site can be accessed w/o problems when using its original port (8080) but not when accessing it through a reverse proxy (running on port 443 since encryption is required for authentication). When accessing the site through the proxied connection, the infamous “Please wait…” is displaed.
The reverse proxy is implemented through nginx with the following simple configuration as suggested in other posts:
server {
listen …
Aha, I finally figured this out from here! Any changes regarding websocket for Streamlit v1.14 vs. 1.18? - #2 by andfanilo
Between versions of streamlit, the endpoint /stream was changed to /_stcore/stream. So anywhere the nginx configuration has the former had to be replaced with the latter. Now it seems to be working again fine!
UPDATE: If you think you have the configuration right, but it’s still not working for you, see if it works on another machine.
Even with the proper endpoint again, …
system
Closed
June 5, 2024, 3:07am
5
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.