From a330ff8b33ff46fe98d32a64c36e219b4a8c1e82 Mon Sep 17 00:00:00 2001 From: jurafxp Date: Sat, 14 Oct 2017 22:35:35 +0200 Subject: [PATCH] Working Apache config for websockets (#3623) --- source/_docs/ecosystem/apache.markdown | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/source/_docs/ecosystem/apache.markdown b/source/_docs/ecosystem/apache.markdown index d8ec1aac020..ae0c1925114 100644 --- a/source/_docs/ecosystem/apache.markdown +++ b/source/_docs/ecosystem/apache.markdown @@ -32,13 +32,19 @@ To be able to access to your Home Assistant instance by using https://home.examp ```text - ProxyPreserveHost On - ProxyRequests Off ServerName home.example.org - ProxyPass /api/websocket ws://localhost:8123/api/websocket - ProxyPassReverse /api/websocket ws://localhost:8123/api/websocket + ProxyPreserveHost On + ProxyRequests off ProxyPass / http://localhost:8123/ ProxyPassReverse / http://localhost:8123/ + ProxyPass /api/websocket ws://localhost:8123/api/websocket + ProxyPassReverse /api/websocket ws://localhost:8123/api/websocket + + RewriteEngine on + RewriteCond %{HTTP:Upgrade} =websocket [NC] + RewriteRule /(.*) ws://localhost:8123/$1 [P,L] + RewriteCond %{HTTP:Upgrade} !=websocket [NC] + RewriteRule /(.*) http://localhost:8123/$1 [P,L] ```