From ef3212861272176bc60541ef8239e4dfb2260cf5 Mon Sep 17 00:00:00 2001 From: Olivier Lambert Date: Tue, 10 Nov 2015 14:01:51 +0100 Subject: [PATCH] Update reverse_proxy.md --- reverse_proxy.md | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/reverse_proxy.md b/reverse_proxy.md index ad39e9532..4b8715e14 100644 --- a/reverse_proxy.md +++ b/reverse_proxy.md @@ -1,2 +1,35 @@ # Reverse proxy +## Apache + +As XO-web and XO-server communicates with *WebSockets*, you need to have the `mod_proxy_wstunnel` in Apache (please [check the Apache documentation](http://httpd.apache.org/docs/2.4/mod/mod_proxy_wstunnel.html) about it). It's available for Apache 2.4.5 and later. + + +Please use this configuration in this order or it will not work: + +```apache +ProxyPass /[]/api ws://:/api +ProxyPass /[] http://:/ + +ProxyPassReverse /[] / +``` + + +## NGINX + +Just configure your VirtualHost as usual (or your default site), with a section `location` like this one: + + +```nginx +location /[] { + proxy_pass http://[:]/; + + proxy_http_version 1.1; + proxy_set_header Connection "upgrade"; + proxy_set_header Upgrade $http_upgrade; + + proxy_redirect default; +} +``` + +That's all! \ No newline at end of file