Initially I started using Cloudflare Zero Trust tunnel as an Addon in Home Assistant, with the configuration of the connector done in Home Assistant. This worked fine most of the time, but obviously caused problems when Home Assistant was restarted, down for maintenance, etc.
I decided to migrate the tunnel so that the configuration is done through the Cloudflare Dashboard, and run several connectors on docker-servers in order to have backup. I use one LXC on Proxmox running Docker, and another connector on a Raspberry Pi4 running Docker.
In Home Assistant – configuration.yaml, make sure to specify the server(s) IP-address where the connector is running:
http:
use_x_forwarded_for: true
trusted_proxies:
#- 172.30.33.0/24 # Old configuration from Cloudflare Addon
#- 192.168.86.77 # Server1 where Cloudflare connector is running
#- 192.168.86.102 # Server2 where Cloudflare connector is running
- 192.168.86.0/24 # Whole subnet