2
我在rails 5中實現動作電纜,它在本地工作完美,但在分段和生產中,在發送消息到動作之後,電纜軌記錄器就是這樣。ActionCable不發送消息
[ActionCable] Broadcasting to chats_4: {:id=>"message_97", :message=>"88", :user=>"John", :time=>"15-May-17 06:38 am", :chatroom_id=>4, :file=>nil}
但它不傳輸到用戶,瀏覽器控制檯提供了錯誤
Firefox can’t establish a connection to the server at wss://demo.xyz.com/cable.
The connection to wss://demo.xyz.com/cable was interrupted while the page was loading.
我的環境配置如下。
config.action_cable.url = "wss://demo.xyz.com/cable"
config.action_cable.allowed_request_origins = ['https://demo.xyz.com', 'http://demo.xyz.com']
我客運託管應用程序+ nginx的
location /cable {
passenger_app_group_name xyz_websocket;
passenger_force_max_concurrent_requests_per_process 0;
}
我nginx的日誌說
2017/05/15 06:43:30 [error] 13412#0: *675 open() "/home/test/apps/xyz/current/public/cable" failed (2: No such file or directory), client: 103.xix.204.xx, server: https://demo.xyz.com, request: "GET /cable HTTP/1.1", host: "demo.xyz.com"
幫助我如何解決這個問題。
「乘客上運行它作爲一個獨立的過程,實際上堅持」我已經實現了相同的 – Navin