ActionCable not working with Unicorn in Rails server (nginx)

I have a RoR project.

However, when I use Nginx and Unicorn to run my actioncable on a production server, it doesn't work like it does in my Rails environment.

I got the error as below:

Rack :: Lint :: LintError: status must be> = 100 as integer

I cannot figure out the reason for the error.

+3


source to share


2 answers


I went through the same error and the below solution worked for me. You can update the file nginx.confi

using the following configurations:

 location /cable/ {
       proxy_pass http://$app_server;
       proxy_http_version 1.1;
       proxy_set_header Upgrade $http_upgrade;
       proxy_set_header Connection "Upgrade";
    }

      



I hope this solution helps :)

+6


source


Try adding ENV ['RACK_ENV'] = "deploy" to your unicorn config file. See this question for more details: https://github.com/rails/rails/issues/26179



0


source







All Articles