diff options
author | lookshe <github@lookshe.org> | 2015-03-14 22:11:16 +0100 |
---|---|---|
committer | lookshe <github@lookshe.org> | 2015-03-14 22:11:16 +0100 |
commit | 7d78dc663fe8884cbd81844e3e5d7e43bf88f0f8 (patch) | |
tree | 75ae04e377efd6e06e6cd70bf33b739d98f7fd7b | |
parent | b60df56157ee1fd0bd4938799bac05a62fda91a1 (diff) |
-modified readme
- add config example for signaling server behing varnish
-rw-r--r-- | README.md | 4 | ||||
-rw-r--r-- | signaling-server/varnish.config | 37 |
2 files changed, 40 insertions, 1 deletions
@@ -1 +1,3 @@ -Audio/Video and Messaging WebRTC chat inspired by http://symple.sourcey.com/ +Audio/Video and Messaging WebRTC chat inspired by [symple.sourcey.com](http://symple.sourcey.com/) + +A working version is hosted under [chat.lookshe.org](http://chat.lookshe.org/) diff --git a/signaling-server/varnish.config b/signaling-server/varnish.config new file mode 100644 index 0000000..d1d667b --- /dev/null +++ b/signaling-server/varnish.config @@ -0,0 +1,37 @@ +################################################################################################################################# +# inspired by http://serverfault.com/questions/370890/best-way-to-deploy-my-node-js-app-on-a-varnish-nginx-server/371008#371008 # +################################################################################################################################# + +# to use the signaling server behind a varnish cache server you need to define a backend for it + +backend nodejs { + .host = "127.0.0.1"; + #.host = "148.251.154.68"; + .port = "4500"; +} + + +# and also some modifications in vcl_recv + +if (req.http.Upgrade ~ "(?i)websocket") { + set req.backend = nodejs; + return (pipe); +} +if (req.http.host == "chat.lookshe.org") { + if (req.url ~ "^/socket.io/") { + set req.backend = nodejs; + return (pipe); + } +} + + +# and at least vcl_pipe + +sub vcl_pipe { + #Need to copy the upgrade for websockets to work + if (req.http.upgrade) { + set bereq.http.upgrade = req.http.upgrade; + } + set bereq.http.Connection = "close"; + return (pipe); +} |