Advertisement
Guest User

Untitled

a guest
Apr 20th, 2024
41
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.45 KB | None | 0 0
  1. - locally, home assistant is at http://192.168.1.125:8123
  2. - I need reverse proxy available at https://mydomain.com/home-assistant
  3. - Virtual host https://mydomain.com exsits and it should not be touched
  4.  
  5. My virtual host setup:
  6.  
  7. ```
  8. <VirtualHost *:443>
  9.  
  10.  
  11. ProxyPreserveHost On
  12. ProxyRequests off
  13. ProxyPass /home-assistant/api/websocket ws://192.168.1.125:8123/api/websocket
  14. ProxyPassReverse /home-assistant/api/websocket ws://192.168.1.125:8123/api/websocket
  15. ProxyPass /home-assistant http://192.168.1.125:8123
  16. ProxyPassReverse /home-assistant http://192.168.1.125:8123
  17.  
  18. RewriteEngine on
  19. RewriteCond %{HTTP:Upgrade} =websocket [NC]
  20. RewriteRule /home-assistant/(.*) ws://192.168.1.125:8123/$1 [P,L]
  21. RewriteCond %{HTTP:Upgrade} !=websocket [NC]
  22. RewriteRule /home-assistant/(.*) http://192.168.1.125:8123/$1 [P,L]
  23.  
  24.  
  25. SSLEngine On
  26.  
  27.  
  28. DocumentRoot /home/michal/sites/webmail
  29.  
  30.  
  31. ServerAlias www.mydomain.com
  32. Include /etc/letsencrypt/options-ssl-apache.conf
  33. SSLCertificateFile /etc/letsencrypt/live/mydomain.com/fullchain.pem
  34. SSLCertificateKeyFile /etc/letsencrypt/live/mydomain.com/privkey.pem
  35. </VirtualHost>
  36. ```
  37. But it does not work. When accessing https://mydomain.com/home-assistant home assistant logo is loaded and I can see home assistant sitl tries to load its resources from mydomain.com/ url, not mydomain/home-assistant/ url, so it won't load
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement