Hello guys,
I’m trying to deploying my streamlit app with AWS Cloudfront.
The streamlit server is dockerized and run in a ECS Service with an Application ELB without problems.
But when I’m trying to use Cloudfront with the ELB address as origin the application stay in a loop showing me “Please wait…” as in this image
Hi,
same issue here, was curios if you solved the issue.
tried diff versions of ST 0.74, 0.72
disabled http2 in ALB
error persist if accessing docker image without ALB but site loads faster and don’t get stucked in wss error loop . triend Chrome, Firebox, Safari
-healthz responds ok using ALB
-using chrome incognito page seems to loads faster for the first time
-ALB logs give a 404 for GET …443/static/js/main.cf1968bf.chunk.js.map HTTP/1.1
Hi @enryls !
I ran into EXACTLY the same issue yesterday.
Using an ECS Service with application load balancer. Until here everything works fine, but adding the Cloudfront to it results in the “Please Wait” endless loop.
Could you already figure it out? I’m thinking of cashing issues and a mismatch between Streamlit and Cloudfront settings, but was not successful until now…
Haha… @enryls
While I was writing my previous reply my latest changes to the Cloudfront settings were deployed and now tadaaa it looks lie it is working. What did the trick:
Cloudfront → Behaviour → Switching from “Use a cache policy and origin request policy” to “Use legacy cache settings”.
If you’re still facing this issue maybe you can try this setting and let me know if it works for you as well?
In “Cache key and origin requests” be sure to set “Origin Request Policy” to “AllViewer”.
For websocket to work through cloudfront, there is a number of Sec-Websocket headers that need to be forwarded (Using WebSockets with CloudFront distributions - Amazon CloudFront). You can either manually dial them all in or simply allow forwarding everything, which is what this setting does. Worked for me.
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.