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

Reverse proxy connection upgrade header lowercase issue #3506

Closed
eyups opened this issue Mar 10, 2024 · 1 comment
Closed

Reverse proxy connection upgrade header lowercase issue #3506

eyups opened this issue Mar 10, 2024 · 1 comment
Labels

Comments

@eyups
Copy link

eyups commented Mar 10, 2024

Describe the issue you are experiencing

  1. Setup a CDN -> NGINX Home Assistant SSL proxy -> HA configuration
  2. Some CDN's (In my case my Keenetic modem's KeenDNS dynamic DNS service) doesn't accept
proxy_set_header Connection upgrade;

with lowercase.
3. Instead they accept ->

proxy_set_header Connection Upgrade;

So https://github.com/home-assistant/addons/blob/master/nginx_proxy/rootfs/etc/nginx.conf needs to be changed with:

map $http_upgrade $connection_upgrade {
        default Upgrade;
        ''      close;
    }

This helped me solve my issue putting additional nginx server between CDN and HA server to be able to add access control lists etc.

I found this information on nginx's blog post. (https://www.nginx.com/blog/websocket-nginx/)

image

What type of installation are you running?

Home Assistant OS

Which operating system are you running on?

Home Assistant Operating System

Which add-on are you reporting an issue with?

NGINX Home Assistant SSL proxy

What is the version of the add-on?

3.8.0

Steps to reproduce the issue

  1. Setup a CDN -> NGINX Home Assistant SSL proxy -> HA configuration
  2. Some CDN's (In my case my Keenetic modem's KeenDNS dynamic DNS service) doesn't accept
proxy_set_header Connection upgrade;

with lowercase.
3. Instead they accept ->

proxy_set_header Connection Upgrade;

It gives 502 Bad Gateway error when we try to reach the page

System Health information

System Information

version core-2024.2.1
installation_type Home Assistant OS
dev false
hassio true
docker true
user root
virtualenv false
python_version 3.12.1
os_name Linux
os_version 6.1.73-haos-raspi
arch aarch64
timezone Europe/Istanbul
config_dir /config
Home Assistant Community Store
GitHub API ok
GitHub Content ok
GitHub Web ok
GitHub API Calls Remaining 4894
Installed Version 1.33.0
Stage running
Available Repositories 1405
Downloaded Repositories 15
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 Home Assistant OS 12.0
update_channel stable
supervisor_version supervisor-2024.02.1
agent_version 1.6.0
docker_version 24.0.7
disk_total 234.0 GB
disk_used 9.7 GB
healthy true
supported true
board rpi4-64
supervisor_api ok
version_api ok
installed_addons Home Assistant Google Drive Backup (0.112.1), ESPHome (2023.12.9), RTSP Simple Server Add-on (v0.17.6), Advanced SSH & Web Terminal (17.1.0), File editor (5.8.0), Samba share (12.3.0), eufy-security-ws (1.8.0), NGINX Home Assistant SSL proxy (3.8.0), Let's Encrypt (5.0.15), EYUPS NGINX Home Assistant SSL proxy (3.8.0)
Dashboards
dashboards 1
resources 5
views 3
mode storage
Recorder
oldest_recorder_run February 18, 2024 at 9:02 AM
current_recorder_run March 10, 2024 at 7:14 PM
estimated_db_size 811.72 MiB
database_engine sqlite
database_version 3.44.2
Sonoff
version 3.5.4 (a4a8c5f)
cloud_online 1 / 1
local_online 1 / 1
Xiaomi Miot Auto
component_version 0.7.16
can_reach_server ok
can_reach_spec ok
logged_accounts 1
total_devices 4

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

No response

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

No response

Additional information

No response

Copy link

github-actions bot commented Apr 9, 2024

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 Apr 9, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Apr 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant