Forward real IP from Nginx addon?

I can’t seem to figure out how to get the Nginx proxy addon to forward the real IP to Home Assistant. All IPs logged shows 172.x.x.x, which is the IP of the proxy container. I tried following the vague mention in the description about enabling custom config and putting a *.conf file in the share path. I tried that but it does not insert the Ngnix header config in the right place.

image

[root@assistant ~]# docker inspect addon_core_nginx_proxy | jq -r .[].NetworkSettings.Networks.hassio.IPAddress
172.30.33.1

Nginx Proxy Configuration

domain: assistant.example.com
certfile: fullchain.pem
keyfile: privkey.pem
hsts: max-age=31536000; includeSubDomains
cloudflare: false
customize:
  active: true
  default: nginx_proxy_default*.conf
  servers: nginx_proxy/*.conf

You are probably missing some options in the http component. Just like I was :wink:

adding use_x_forwarded_for: true and the trusted_proxies entries fixed it for me.

Full example:

http:
  ip_ban_enabled: true
  login_attempts_threshold: 3
  use_x_forwarded_for: true
  trusted_proxies:
    - 172.30.33.1