Faye middleware Rails + Nginx

28 views
Skip to first unread message

Tu Truong

unread,
Nov 24, 2017, 4:26:49 AM11/24/17
to Faye users
Hi,
I'm using Faye as Middleware, it works on my local machine without Nginx, but when i deploy it to server using Nginx it's always return error 400.

My application.rb
# config.middleware.use Faye::RackAdapter, {:mount => '/faye', :timeout => 25} do |bayeux|
# bayeux.on(:handshake) do |client_id|
# WebsocketService.monitoring("handshake", client_id)
# end
# end

Last time i'm run Faye as a rack file with proxy_pass for nginx config. Any advise please ?
# This is old config i use for run Faye in port 9292 and it work fine.
location /faye {
proxy_pass http://127.0.0.1:9292;
proxy_http_version 1.1;
proxy_buffers 8 32k;
proxy_buffer_size 64k;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}

Thank you so much.

Reply all
Reply to author
Forward
0 new messages