I am using Jelastic for my development environment (not yet in production). My application is running with Unicorn but I discovered websockets with ActionCable and integrated it in my application.
Everything is working fine in local, but when deploying to my Jelastic environment (with the default NGINX/Unicorn configuration), I am getting this message in my javascript console and I see nothing in my access log
WebSocket connection to 'ws://dev.myapp.com:8080/' failed: WebSocket is closed before the connection is established.
I used to have on my local environment and I solved it by adding the needed ActionCable.server.config.allowed_request_origins in my config file. So I double-checked my development config for this and it is ok.
That's why I was wondering if there is something specific for NGINX config, else than what is explained on ActionCable git page
bundle exec puma -p 28080 cable/config.ru
For my application, I followed everything from enter link description here but nothing's mentioned about NGINX configuration
I know that websocket with ActionCable is quite new but I hope someone would be able to give me a lead on that
Many thanks
config/redis/cable.yml
to be setup such that the production url was set to something other than the default localhost line. I'm using Heroku for production, and since ActionCable uses Redis, I added the Heroku-Redis addon to my application and usedENV['REDIS_URL']
from my Heroku environment variables. I read through your question and figured I'd mention what else I had to do beyond what you've tried. Caveat: production only works with 2 devices out of all the ones of tested with :( – Jake Smith