Trusted Networks: Login Aborted (using reverse proxy)

Hi,

After upgrading from 2021.03 to 2021.10.05, I’ve been having issues with logging in to Home Assistant using trusted networks.

Screenshot 2021-10-22 104829

I’ve followed suggestions from below topics, but to no avail.

You can find my configuration below:

http

ip_ban_enabled: False
login_attempts_threshold: 10
use_x_forwarded_for: true
trusted_proxies: 
  - 127.0.0.1
  - 192.168.10.xxx # gateway
  - 192.168.10.xxx # proxy
  - xxx.xxx.xxx.xxx # external IP (dynamic)

auth

- type: trusted_networks
  allow_bypass_login: true
  trusted_networks:
    - 127.0.0.1
    - 192.168.10.0/24
    - xxx.xxx.xxx.xxx # external IP (dynamic)
- type: homeassistant

nginx

    location / {
                proxy_set_header Host $host;
                proxy_pass http://127.0.0.1:8123;
                proxy_redirect off;
                proxy_http_version 1.1;
                proxy_set_header X-Real-IP $remote_addr;
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header X-Forwarded-Proto $scheme;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection "upgrade";
        }

Been debugging some more. No luck so far.
I changed the nginx settings slightly to better resemble the working config here.

I do wonder; should I be able to see the X-Forwarded-For headers in Developer Tools? Or are those only visible to the Home Assistant server (since the request is being passed through from the reverse proxy)?

any solution so far? have the same issue…

Nothing yet unfortunately…
I’ve reverted to password login for now.

haha… me too

funny… now I got it working

just removed the localhost entries from the trusted proxis… I only have one entry here (because I use the nginx manger addon)

  trusted_proxies:
    - 172.30.32.0/23            # .32.0/24 and .33.0/24 - Docker subnet

and finally the trusted networks are working :slight_smile: HTH