Can't connect to HA via port 8123 from devices on local network but local machine and reverse proxy work fine

I’m trying to get my Konnected board working since update HA to 0.114.4 but I’m not having any luck getting state changes. I think the problem is related to networking issue. This integration setup completes successfully and Konnected is set up with an API endpoint of http://192.168.0.28:8123/api/konnected. (board is at 192.168.0.12 and HA is at 192.168.0.28). The problem I have is that the port 8123 doesn’t seem to be accessible outside of the local machine, so I suspect this is why I’m not getting state changes.

On the local machine, I can go to http://192.168.0.12:8123, and I get the HA web interface. On any other device on the local network, the browser just hangs at ‘connecting’.

I have an apache reverse proxy set up so I can access home assistant outside my local network via https and the websockets are set up to forward to port 8123, so this says to me the port isn’t being blocked.

In configuation yaml I added server_port to ensure
http:
server_port: 8123

I’m just a little stumped as to why I cannot connect to HA via port 8123 from the local network? Is this normal behaviour or am I missing something in the configuration? Also, everything was working prior to the update.

Setup:
Docker installed on a ubuntu VM : HA 0.114.4
Apache reverse proxy set up via (Reverse Proxy with Apache)
Konnected: Software version 2.3.5, firmware 2.3.0

Apache config

<VirtualHost *:80>
  ServerName XXXXXXXXXXXXX
  ServerSignature Off

  RewriteEngine on
  RewriteCond %{HTTPS} !=on
  RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [NE,R,L]

  RewriteCond %{SERVER_NAME} =XXXXXXXXXXXX 
  RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>

#Listen 443
<IfModule mod_ssl.c>
<VirtualHost *:443>
  ServerName XXXXXXXXXXXXXXXX
  ProxyPreserveHost On
  ProxyRequests off
  ProxyPass /api/websocket ws://localhost:8123/api/websocket
  ProxyPassReverse /api/websocket ws://localhost:8123/api/websocket
  ProxyPass / http://localhost:8123/
  ProxyPassReverse / http://localhost:8123/

  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]


  SSLCertificateFile /etc/letsencrypt/live/XXXXXXXXXXXXXXX/fullchain.pem
  SSLCertificateKeyFile /etc/letsencrypt/live/XXXXXXXXXXXXX/privkey.pem
  Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>
</IfModule>

It is not normal behaviour. You should be able to access the HA web interface from your local network.

Why you can’t seems most likely to be the apache setup, which I am not familiar with. Try eliminating it to start with and see if port 8123 works.

I was just about to delete this. I forgot I set up the ubuntu firewall so I just had to open up port 8123

1 Like