Action Cable configuration

config/application.rb

config.web_socket_server_url = "wss://rubysnippets.net/cable"

config/environments/development.rb

config.action_cable.url = "ws://localhost:3000/cable"

config/environments/production.rb

config.action_cable.allowed_request_origins = ['http://rubysnippets.net', 'https://rubysnippets.net']

config/routes.rb

mount ActionCable.server => '/cable'

/etc/nginx/sites-available/default

passenger_enabled on;
passenger_app_env production;

location /cable {
  passenger_app_group_name scry_websocket;
  passenger_force_max_concurrent_requests_per_process 0;
}

location @app {
    proxy_pass http://app;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header Host $http_host;
    proxy_redirect off;

    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-NginX-Proxy true;
}