Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ESPHOME and NGINX Proxy Manager SSL proxy HA addon don't play nicely #4554

Closed
mcarbonneaux opened this issue Mar 13, 2023 · 1 comment
Closed
Labels

Comments

@mcarbonneaux
Copy link

mcarbonneaux commented Mar 13, 2023

In fact esphome don't accept the normal way of nginx is transmiting the browser request host and port to esphome throught ha ingress.

by default when firewall is on front and expose the nginx with diferent port than the nginx port (is the case of nginx proxy manager ha addons is 443) this port are not transmited by default by nginx (nginx use the 443 port in place), and the esphome refuse the connection.

For example:

  • firewall on port 12345 on public ip -> homeassistant nginx proxy manager port 443 on ha private ip (ex: 192.168.xx.xx the ha os ip) -> homeassistant core ui on 8123 (on local container private ip)

with the way of nginx do the 12345 port are not transmited to the backend (the backend receive 443 in place)...

I've found a "clean way" to fix this use of ha ingress with esphome using NGINX proxy manager addon (base on exchange on esphome/issues#1035 (comment)) by using custom location of nginx proxy manager.

i've added the location /api/hassio_ingress/ on the Proxy Host to homeassistant/api/hassio_ingress/ on 8123 port, with http protocol:

image

and i've added the custom configuration :

proxy_set_header Host $http_host;

to force to use the hostname AND port from the browser as transmited by using ($http_host nginx variable) the Host header received in place of the nginx variable $host that not containe the request port.

and also configured Websockets support on the proxy host :

image

@github-actions
Copy link
Contributor

#430

@github-actions github-actions bot added the stale label Mar 15, 2023
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Mar 16, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Mar 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant