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.