I can access my hassio instance through the IP 192.168.1.100:8123, within my LAN, and I am trying to configure the reverse proxy to be able to access homeassistant from outside the home.
Homeassistant is installed in Docker, and in a Debian 11 server where I also have CollaboraOffice online and Nextcloud installed, and we access all of this from WLAN because we resolve DNS with NO-IP
I have added the domain that I have created of homeassistant in NO-IP so that the IP can be resolved
Within /etc/apache2/sites-available I have created the file homeassistant.conf
<VirtualHost *:80>
ServerName home-aaaaa.aaa.com
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
then i did
a2ensite home assistant
systemctl reload apache2
I generated the certificates let’s script with certbot --apache and it was successful, and an SSL file called homeassistant-le-ssl.conf was generated
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerName home-aaaaa.aaa.com
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/home-aaaaa.aaa.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/home-aaaaa.aaa.com/privkey.pem
</VirtualHost>
</IfModule>
And I completed it with this code
<IfModule mod_ssl.c>
<VirtualHost *:443>
ServerName home-aaaaa.aaa.com
ProxyPreserveHostOn
Proxy Requests Off
ProxyPass /api/websocket ws://192.168.1.100:8123/api/websocket
ProxyPassReverse /api/websocket wss://192.168.1.100:8123/api/websocket
ProxyPass / http://192.168.1.100:8123/
ProxyPassReverse / http://192.168.1.100:8123/
RewriteEngine on
RewriteCond %{HTTP:Upgrade} websocket [NC]
RewriteRule ^/?(.*) ws://192.168.1.100:8123/$1 [P,L]
<Location "/">
satisfy any
</Location>
<Location "/api">
satisfy any
</Location>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/home-aaaaa.aaa.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/home-aaaaa.aaa.com/privkey.pem
</VirtualHost>
</IfModule>
I try to access the link home-aaaaa.aaa.com and I get the following message: 400: Bad Request