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

nginx_proxy: Host header causes problems with ESPHome addon #3132

Closed
mancontr opened this issue Jul 13, 2023 · 9 comments
Closed

nginx_proxy: Host header causes problems with ESPHome addon #3132

mancontr opened this issue Jul 13, 2023 · 9 comments

Comments

@mancontr
Copy link
Contributor

mancontr commented Jul 13, 2023

Describe the issue you are experiencing

As discussed here, when using the NGINX SSL Proxy addon together with the ESPHome addon, the websocket requests fail with this error:
Cross origin websockets not allowed

The reason is that the Origin and Host field differ, because the former includes the port, but the latter doesn't.

The fix would be very simple: on the default config, replace $host with $http_host, so it includes the port, on the proxy_set_header Host rule.

I tried this fix and worked correctly for me, and didn't seem to break any of my other addons, but further testing would be nice.

I can send a PR if this fix looks reasonable.

What type of installation are you running?

Home Assistant Supervised

Which operating system are you running on?

Debian

Which add-on are you reporting an issue with?

NGINX Home Assistant SSL proxy

What is the version of the add-on?

3.5.0

Steps to reproduce the issue

  1. Configure the NGINX and ESPHome addons
  2. Access the ESPHome page through ingress, and use the "validate" button
  3. The screen stays black, and an error is reported in the supervisor logs

System Health information

System Information

version core-2023.7.1
installation_type Home Assistant Supervised
dev false
hassio true
docker true
user root
virtualenv false
python_version 3.11.4
os_name Linux
os_version 5.10.0-22-amd64
arch x86_64
timezone Europe/Madrid
config_dir /config
Home Assistant Community Store
GitHub API ok
GitHub Content ok
GitHub Web ok
GitHub API Calls Remaining 5000
Installed Version 1.32.1
Stage running
Available Repositories 1272
Downloaded Repositories 6
Home Assistant Cloud
logged_in false
can_reach_cert_server ok
can_reach_cloud_auth ok
can_reach_cloud ok
Home Assistant Supervisor
host_os Debian GNU/Linux 11 (bullseye)
update_channel stable
supervisor_version supervisor-2023.07.1
agent_version 1.5.1
docker_version 23.0.6
disk_total 217.6 GB
disk_used 16.2 GB
healthy true
supported true
supervisor_api ok
version_api ok
installed_addons Advanced SSH & Web Terminal (15.0.3), Home Assistant Google Drive Backup (0.111.1), Let's Encrypt (4.12.9), Mosquitto broker (6.2.1), NGINX Home Assistant SSL proxy (3.5.0), NanoNVR (1.2.1), Network UPS Tools (0.12.0), Samba share (10.0.2), Zigbee2MQTT (1.32.1-1), Omada Controller Beta (5.9.2), Studio Code Server (5.8.1), AdGuard Home (4.8.11), ESPHome (2023.6.5)
Dashboards
dashboards 1
resources 5
views 8
mode storage
Recorder
oldest_recorder_run 9 de julio de 2023, 22:05
current_recorder_run 10 de julio de 2023, 00:05
estimated_db_size 192.32 MiB
database_engine sqlite
database_version 3.41.2

Anything in the Supervisor logs that might be useful for us?

23-07-13 09:40:53 ERROR (MainThread) [supervisor.api.ingress] Ingress error: 403, message='Invalid response status', url=URL('http://172.30.32.1:63409/validate')

Anything in the add-on logs that might be useful for us?

No response

Additional information

No response

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale label Aug 12, 2023
@mancontr
Copy link
Contributor Author

The problem is still happening, and a fix is already known - just one line.
Any chance someone can take a look at this?

@github-actions github-actions bot removed the stale label Aug 14, 2023
@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale label Sep 13, 2023
@vdemidov
Copy link

The problem is still happening

Copy link

github-actions bot commented Nov 8, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale label Nov 8, 2023
@mancontr
Copy link
Contributor Author

mancontr commented Nov 13, 2023

I just checked and this still happens. This has been stalling for 4 months, affecting multiple addons and with a simple, single-line fix already proposed. Is there anything I can do to get it through?

@github-actions github-actions bot removed the stale label Nov 13, 2023
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale label Dec 13, 2023
@mancontr
Copy link
Contributor Author

Just checked again, and the issue keeps happening...

@agners
Copy link
Member

agners commented Dec 14, 2023

I can confirm that #3356 fixes the log errors when connecting through the NGINX Proxy add-on with a non-default port. 🎉

Thanks!

@agners agners closed this as completed Dec 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants