Enabling support for the X-Forwarded-For header in Home Assistant allows Homeway and other proxy servers to give Home Assistant the user’s IP address when making requests. This allows Home Assistant to know the user’s actual IP address, not the IP address of the server proxying the web requests.
Knowing the real user’s IP address is helpful for many Home Assistant features, such as WebRTC peer-to-peer connection negotiation, IP banning for failed login attempts, and more.
If you’re using the Homeway add-on in Home Assistant, it will configure this automatically!
If you’re using the standalone Homeway add-on or another proxy server, such as DuckDNS or nginx, you need to manually configure the proxy settings in Home Assistant’s config. yaml file.
- Get access to the Home Assistant configuration.yaml file.
- Find the IP address of your Homeway standalone add-on or other proxy server.
- Add the following configuration to the bottom of the Home Assistant configuration.yml file.
http:
use_x_forwarded_for: true
trusted_proxies:
- 172.30.32.0/23 # This allows add-ons running in HA access
- 192.168.1.15 # This allows a reverse proxy on your home LAN access
Be sure to update the example IP address 192.168.1.15 with the IP address of your Home Assistant standalone add-on or other proxy server. Your IP address might start with 192.168. 10.0. .
Restart Home Assistant, and you’re all set!