OPNsense Forum

Archive => 23.1 Legacy Series => Topic started by: Lowrider614 on March 29, 2023, 09:28:57 PM

Title: OPNSense, nginx and Home Assistant
Post by: Lowrider614 on March 29, 2023, 09:28:57 PM
Hello,
I have nginx setup as reverse proxy with SSL and that works. When I enter the dome to my Home Assistant docker running on my Synology nas on port 8123, I get a "400: Bad Request" error.

Does anyone have some screenshots for me how to setup nginx so I can access Home Assistant?

Thanks!

Tim
Title: Re: OPNSense, nginx and Home Assistant
Post by: Fright on March 30, 2023, 10:04:26 PM
Hi
i'm not using HomeAssistant but as I understand it requires an explicitly specified port in the Host header.
(https://github.com/opnsense/plugins/issues/3317)
So far, there is no way to do this in the nginx plugin gui (will need to use hooks).
although i haven't come across such a solution with quick qoogling, i would suggest (if possible) to add an external_url option with a standard port (like https://somerandomname.duckdns.org) in the application settings and use it to configure upstream in nginx.
might work
Title: Re: OPNSense, nginx and Home Assistant
Post by: nzkiwi68 on March 31, 2023, 05:46:32 AM
Wouldn't HAPROXY be a better fit?

You can definitely get HAPROXY to change the header etc on the fly.
Title: Re: OPNSense, nginx and Home Assistant
Post by: bimbar on March 31, 2023, 09:55:31 AM
There is configuration to be done on the HA side, there are various guides on the subject, for example: https://community.home-assistant.io/t/reverse-proxy-using-nginx/196954