Kamal + Traefik + SSL = Actioncable not working

Hey everyone!

Maybe someone has faced this problem. Locally everything works fine but as soon as I deploy to staging with the help of Kamal I receive the erorr in browser that I can’t connect to /cable and connection was refused.

How can I debug it?

Nothing in server logs and client logs are not informative at all: just show me that error occures.

1 Like

Hi,

I had a similar issue, where the browser couldn’t connect to /cable. Safari would also throw the error NS_ERROR_WEBSOCKET_CONNECTION_REFUSED.

The solution was described in this issue: Rails WSS connection broken · Issue #738 · basecamp/kamal · GitHub. I had to set the following two things:

  1. config.action_cable.allowed_request_origins = [ "https://my.domain.com"]
  2. config.force_ssl = false