4

I have an event-machine websocket application (using the em-websocket gem) and it runs fine. The problem is that I need to deploy it using port 80 through nginx (can't compile it with tcp proxy module). Is it possible to use a simple nginx proxy_pass pointing to a thin server and have the thin server to pass the requests to my websocket server?

marcosbeirigo
  • 11,098
  • 6
  • 39
  • 57

1 Answers1

2

From what I understand you can't proxy websocket traffic with a proxy_pass.

Since web sockets are done over HTTP 1.1 connections (where the handshake and upgrade are completed), your backend needs to support HTTP 1.1, and from what I have researched, they break the HTTP 1.0 spec...

I've seen some people try to do the same thing with socket.io and HAProxy (see links). I would guess that you could try to swap out the socket.io with em-websockets and expect similar results.

1: http://www.letseehere.com/reverse-proxy-web-sockets

2: HAProxy + WebSocket Disconnection

Community
  • 1
  • 1
nickethier
  • 226
  • 2
  • 8