prefixkit Ask an engineerAsk Support RU

Error reference · Home Assistant

Home Assistant: Received X-Forwarded-For header from an untrusted proxy 172.18.0.2

Received X-Forwarded-For header from an untrusted proxy 172.18.0.2

What it means

use_x_forwarded_for is on, but the request came through a proxy whose address is not in trusted_proxies, so Home Assistant rejects it.

Why it happens

  • The proxy runs in Docker and its address changes or is not the one you listed (Docker networks are 172.16.0.0/12).
  • A second proxy in the chain (for example Cloudflare in front of nginx) is not listed.

How to fix it

  1. Add the exact address from the message, or the Docker network (172.16.0.0/12), to trusted_proxies.
  2. With several proxies list every one between the client and Home Assistant.
  3. Restart Home Assistant after the change.

Useful tools

/home-assistant-remote-access/

Other Home Assistant errors

Idea?