From: Giorgio Ravera Date: Mon, 26 Dec 2022 02:45:26 +0000 (+0100) Subject: Added Home Assistant SSL interface X-Git-Url: http://git.giorgioravera.it/?a=commitdiff_plain;h=d57c3a642d8f7c145051a3d40f7945e0439b4b25;p=apache.git Added Home Assistant SSL interface --- diff --git a/sites-available/code.giorgioravera.it.conf b/sites-available/code.giorgioravera.it.conf new file mode 100644 index 0000000..ae1aecf --- /dev/null +++ b/sites-available/code.giorgioravera.it.conf @@ -0,0 +1,36 @@ + + ServerName code.giorgioravera.it + ServerAdmin giorgio@giorgioravera.it + Redirect permanent / https://code.giorgioravera.it + + + + + ServerName code.giorgioravera.it + ServerAdmin giorgio@giorgioravera.it + + SSLProxyEngine on + ProxyPass / https://code.giorgioravera.it/ + ProxyPassReverse / https://code.giorgioravera.it/ + + RewriteEngine on + RewriteCond %{HTTP:Upgrade} =websocket [NC] + RewriteRule /(.*) wss://code.giorgioravera.it/$1 [P,L] + + # Available loglevels: trace8, ..., trace1, debug, info, notice, warn, + # error, crit, alert, emerg. + # It is also possible to configure the loglevel for particular + # modules, e.g. + #LogLevel info ssl:warn + + ErrorLog ${APACHE_LOG_DIR}/error.log + CustomLog ${APACHE_LOG_DIR}/access.log combined + + # For most configuration files from conf-available/, which are + # enabled or disabled at a global level, it is possible to + # include a line for only one particular virtual host. For example the + # following line enables the CGI configuration for this host only + # after it has been globally disabled with "a2disconf". + #Include conf-available/serve-cgi-bin.conf + + diff --git a/sites-available/home.giorgioravera.it.conf b/sites-available/home.giorgioravera.it.conf index 490d990..f9acadb 100644 --- a/sites-available/home.giorgioravera.it.conf +++ b/sites-available/home.giorgioravera.it.conf @@ -9,21 +9,26 @@ ServerName home.giorgioravera.it ServerAdmin giorgio@giorgioravera.it - #ProxyPass /esphome http://home.giorgioravera.it/esphome/ - #ProxyPassReverse /esphome http://home.giorgioravera.it/esphome/ - #ProxyPass /zigbee2mqtt http://home.giorgioravera.it/zigbee2mqtt/ - #ProxyPassReverse /zigbee2mqtt http://home.giorgioravera.it/zigbee2mqtt/ + #ProxyPass /api/websocket ws://home.giorgioravera.it:8123/api/websocket + #ProxyPassReverse /api/websocket ws://home.giorgioravera.it:8123/api/websocket + #ProxyPass / http://home.giorgioravera.it:8123/ + #ProxyPassReverse / http://home.giorgioravera.it:8123/ - ProxyPass /api/websocket ws://home.giorgioravera.it:8123/api/websocket - ProxyPassReverse /api/websocket ws://home.giorgioravera.it:8123/api/websocket - ProxyPass / http://home.giorgioravera.it:8123/ - ProxyPassReverse / http://home.giorgioravera.it:8123/ + RewriteEngine on + #RewriteCond %{HTTP:Upgrade} =websocket [NC] + #RewriteRule /(.*) ws://home.giorgioravera.it:8123/$1 [P,L] + #RewriteCond %{HTTP:Upgrade} !=websocket [NC] + #RewriteRule /(.*) http://home.giorgioravera.it:8123/$1 [P,L] + + SSLProxyEngine on + ProxyPass / https://home.giorgioravera.it/ + ProxyPassReverse / https://home.giorgioravera.it/ RewriteEngine on RewriteCond %{HTTP:Upgrade} =websocket [NC] - RewriteRule /(.*) ws://home.giorgioravera.it:8123/$1 [P,L] + RewriteRule /(.*) wss://home.giorgioravera.it/$1 [P,L] RewriteCond %{HTTP:Upgrade} !=websocket [NC] - RewriteRule /(.*) http://home.giorgioravera.it:8123/$1 [P,L] + RewriteRule /(.*) https://home.giorgioravera.it/$1 [P,L] # Available loglevels: trace8, ..., trace1, debug, info, notice, warn, # error, crit, alert, emerg.