addons icon indicating copy to clipboard operation
addons copied to clipboard

nginx_proxy: X-Forwarded-For not working for IPv6 addresses

Open mijofa opened this issue 3 years ago • 0 comments

Describe the issue you are experiencing

I've spent a good number of hours trying to figure out why the X-Forwarded-For didn't seem to be working at all as everything seems to be reporting the client IP as '172.30.32.1'. Eventually I've found that it does actually work if I turn off IPv6 on the client device that I'm browsing from.

I have correctly updated my configuration.yaml:

http:
  use_x_forwarded_for: true
  trusted_proxies:
    - 172.30.33.0/24

I've even tried setting with a bunch of various combinations of these too, but they don't make any difference:

- 172.30.0.0/16
- ::1
- 127.0.0.1
- 0.0.0.0/0 
- ::/0

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.1.5

Steps to reproduce the issue

  1. Have working IPv6
  2. Follow instructions to set up the add-on, including the configuration.yaml changes
  3. Try to log in to Home Assistant with the wrong password via this add-on over IPv6
  4. Login properly and you'll see a notification saying something like this:

    Login attempt or request with invalid authentication from 172.30.32.1. See the log for details.

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

mijofa avatar Sep 07 '22 04:09 mijofa