Reverse Proxy - Homeassistant Cast not working properly

So I just got around setting up a reverse proxy for my Raspberry Pi running HomeAssistant and UniFi as Docker containers using Apache.
At first glance everything seemed to work fine.
But as I tried setting up Home Assistant Cast again today I noticed that all my Custom Components did not load on my Nest Hub.
I could see default Lovelace components but got the red error for anything custom.
All other devices (PCs, smartphone, tablets) work absolutely fine.

Here is my apache config file

<VirtualHost *:443>

  SSLProxyEngine on
  SSLCertificateFile /etc/letsencrypt/live/
  SSLCertificateKeyFile /etc/letsencrypt/live/
  Include /etc/letsencrypt/options-ssl-apache.conf

  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]

Has anyone done reverse proxy + Cast before and could point me in the right direction?

1 Like

Did you find a solution ?
Iā€™m also stuck
Same configuration, but i get the message : error unable to connect to the home assistant websocket api