Websocket Proxy for Home Assistant

How can I setup a websocket proxy for Home Assistant? I've looked on the wiki, however the guide is confusing and ineffective. Please could someone explain the process for Home Assistant.

Another guide for setting OLS as a proxy

Feel free to ask if you have any set questions.
Looking at the recommended Apache configuration here: https://community.home-assistant.io/t/reverse-proxy-with-apache/196942/12

I've come out with this:

Apache config:
#fix detecting incorrect login IP by proxy server
RemoteIPHeader X-Forwarded-For

RewriteEngine On
#RewriteRule ^(.*)$ https://HASS/$1 [P]
#RewriteCond %{HTTP:Upgrade} websocket [NC]
#RewriteRule ^/?(.*) "ws://HASS/$1" [P]
RewriteCond %{HTTP:Upgrade} =websocket
RewriteRule /(.*) ws://srv.maicol07.it:8123/$1 [P]
RewriteCond %{HTTP:Upgrade} !=websocket
RewriteRule /(.*) https://HASS/$1 [P]

#Set security on certan areas(some redacted)
<Location "/">
    Satisfy any
<Location "/api">
    Satisfy any
where HASS is the name of my external app in LSWC.

The web proxy works, but the websocket doesn't work...
Do you have any clue?

I think the part that's missing is the ProxyPass one, however I don't know how to do it in OLS, since copy-pasting the rules isn't working...
Last edited:
Solved this issue with the help of @Cold-Egg and @RukaiWang.
The issue was that SSL was enabled for Home Assistant server and that failed the SSL cert check.
Basically you have to setup a standard reverse proxy with context and webapp in WebAdmin console and a new Websocket proxy like mine:

External app:
Context proxy:
Websocket proxy: