I have created a small page with turbo, mainly to speed up navigation and I want to keep a websocket connection alive while navigating through the webapp which is not a singlepage app. Later I also want to look into turbo streams or integrate stimulus. The whole thing is mainly a hobby project for the next weeks .)
Basically I currently have two pages for testing linking to each other.
Everything works locally so I tried to deploy it on amazon ecs.
The app is running now in a container behind a load balancer and it works in http mode, but when navigating in https it reloads the page on every navigation. Is there some kind of setting I have to do? what could be the issue?
Thanks for your help,
Have you configured your server to pass wss as well as ws traffic to your app? There’s a separate security level needed for secure web sockets. It depends on your server where and how you set this, but that’s the direction I would look. If your application server is behind a proxy, you may need a separate proxy pass rule to cover just that kind of traffic.
Thanks for the hint, but I’m not yet using websockets.
I found the problem in the url generating function in my backend. Because it is behind the load balancer it thought that it would serve http only … so it generated http links. The browser ignored that because of the HSTS configuration for the domain, but turbo thought it would be a https->http link and because of that reload the page instead of doing the ajax call.
I should be able to fix that by looking at the X-Forwarded Header from the loadbalancer to generate the correct links