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 Screenshot 2020-12-17 at 11.04.591894×624 140 KB
In the console I can see that that every second are raised two errors:

WebSocket connection to ‘’ failed: WebSocket is closed before the connection is established.
main.cf1968bf.chunk.js:2 Uncaught Error: Unsupported state transition.
State: PINGING_SERVER
Event: CONNECTION_TIMED_OUT

my current config.toml file is like this:

[global]
disableWatchdogWarning = false
sharingMode = “off”
showWarningOnDirectExecution = true
[logger]
level = “info”
[client]
caching = true
displayEnabled = true
[runner]
magicEnabled = true
installTracer = false
fixMatplotlib = true
[server]
folderWatchBlacklist = 
fileWatcherType = “auto”
headless = true
liveSave = false
runOnSave = false
port = 8501
baseUrlPath = “”
maxUploadSize = 50
enableCORS = false
enableXsrfProtection=false
enableWebsocketCompression = false
[browser]
serverAddress = “0.0.0.0”
gatherUsageStats = false
serverPort = 8501
[mapbox]
token = “pk.eyJ1IjoidGhpYWdvdCIsImEiOiJjamh3bm85NnkwMng4M3dydnNveWwzeWNzIn0.vCBDzNsEF2uFSFk2AM0WZQ”
[s3]
keyPrefix = “”

I’ve tried several combinations of those three values

enableXsrfProtection
enableWebsocketCompression
enableCORS

but don’t seems like a problem related to them.
Have you experencied something like this or do you have any idea?