I think you need some additional nginx config with proxy_ā¦ parameters.
I havenāt used with docker but I have gotten streamlit/nginx/https working in a Windows VM using tips from this post. I believe the following nginx config was what fixed the ā¦ connecting ā¦ timeout issue for me.
Thank you for your reply, and for giving me some encouragement, agray!
Despite trying itās not working, however. I have something like you suggest in my nginx config, which Iāll post here:
` # This file overrides default nginx HTTP settings for my.example.com
Mount this file as ā/var/lib/nginx-conf/my.example.com.conf.erbā
Also I have that on starting up streamlit emits: subdomain_1 | You can now view your Streamlit app in your browser. subdomain_1 | subdomain_1 | Network URL: http://172.21.0.2:8501 subdomain_1 | External URL: http://79.247.21.93:8501
So I switched all the 172.0.0.1 to 172.21.0.2 , but unfortunately it did not work either ā¦
@H_Felix_Wittmann Thanks for sharing the config!
I updated the config since ssl on; isnāt allowed anymore (removed it)
There is also the config included to enable basic auth:
server {
listen 443 ssl http2;
# domain.name will be "my.example.com", you can also hard-code it.
server_name <%= domain.name %>;
ssl_certificate <%= domain.chained_cert_path %>;
ssl_certificate_key <%= domain.key_path %>;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_session_cache shared:SSL:50m;
ssl_ciphers ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA:ECDHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA;
ssl_prefer_server_ciphers on;
ssl_dhparam <%= dhparam_path %>;
<% if domain.basic_auth_enabled? %>
auth_basic "Password";
auth_basic_user_file <%= domain.htaccess_path %>;
<% end %>
location / {
set $backend <%= domain.upstream %>;
proxy_pass $backend;
}
location /stream {
proxy_pass <%= domain.upstream %>/stream;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "Upgrade";
proxy_read_timeout 2h;
}
}
Hello everyoneā¦
Can any one please provide a step-by-step methodology for https:// custom-domain. com to access x.x.x.x:8501 ?
It seems most of us are struggling to get things going.
I was facing the same issue while deploying my streamlitapp via my AWS EC2 instance: http://MyIpAdress:8501 was working without any errors. However, once I tried to bring my ssl certificates within my nginx.conf file in order to be able to run https instead of http, https://MyDomainName didnāt work. Instead, it showed me āPlease Waitā¦ā and somehow I could see that there was an issue with the WebSocket. (http://MyIpAdress:8501 still worked tho)
Changing proxy_set_header Connection āupgradeā;
to proxy_set_header Connection $connection_upgrade;
fixed it for me somehow!
If this doesnāt fix it on your end, just let me know and I can share the entire nginx.conf file.
Thanks for stopping by! We use cookies to help us understand how you interact with our website.
By clicking āAccept allā, you consent to our use of cookies. For more information, please see our privacy policy.
Cookie settings
Strictly necessary cookies
These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.
Performance cookies
These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.
Functional cookies
These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.
Targeting cookies
These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.