400 Bad Request with a reverse proxy despite proper compose.yml

I’m using Nginx as a reverse proxy so I can take my HA instance (at 172.16.10.131:8123) to just homeassistant/

However, I keep getting

2024-07-06 15:30:57.440 ERROR (MainThread) [homeassistant.components.http.forwarded] A request from a reverse proxy was received from 172.16.10.132, but your HTTP integration is not set-up for reverse proxies

Following other topics, I’ve added my nginx IP to compose.yml, with the following:

http:
use_x_forwarded_for: true
trusted_proxies:
- 172.16.10.132

However, I still get a 400 bad request.

To note my nginx is hosted on a separate Raspberry Pi (at 172.16.10.132) and my HA instance is in Docker at 172.16.10.131:8123

I’ve tried using the entire CIDR block, tried adding /23 after the proxy IP, adding ::1 etc.

Any ideas what I’m missing here?

Full compose.yml below:

version: ‘3’
services:
homeassistant:
container_name: homeassistant
image: “Package home-assistant · GitHub
volumes:
- /etc/docker/ha-config:/config
- /etc/localtime:/etc/localtime:ro
- /run/dbus:/run/dbus:ro
restart: unless-stopped
privileged: true
http:
use_x_forwarded_for: true
trusted_proxies:
- 172.16.10.132
network_mode: host
environment:
- DISABLE_JEMALLOC=true

You need to add that to configuration.yaml, not compose yml

Thanks - have now added to configuration.yaml and restared the container but still no dice…

#Loads default set of integrations. Do not remove.
default_config:

#Load frontend themes from the themes folder
frontend:
themes: !include_dir_merge_named themes

automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml

http:
use_x_forwarded_for: true
trusted_proxies:

  • 172.16.10.132

Indentation is wrong

http:
  use_x_forwarded_for: true    
  trusted_proxies:
    - 172.16.10.132

You can easily see in the log what IP to add to trusted_proxies

Thanks - now works. I was aware from log entry

2024-07-06 15:30:57.440 ERROR (MainThread) [homeassistant.components.http.forwarded] A request from a reverse proxy was received from 172.16.10.132, but your HTTP integration is not set-up for reverse proxies

what IP to add (and had been doing that). Just indentation was screwing me up.