--- /dev/null
+<VirtualHost *:80>
+ ServerName code.giorgioravera.it
+ ServerAdmin giorgio@giorgioravera.it
+ Redirect permanent / https://code.giorgioravera.it
+</VirtualHost>
+
+<IfModule mod_ssl.c>
+ <VirtualHost *:443>
+ 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
+ </VirtualHost>
+</IfModule>
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.