Fail to reverse proxy by Caddy2

Hardware: RPi 4b
OS: PiOS (base on debian bookworm)
IP inside home:

HA:
host in docker

services:
  homeassistant:
    container_name: homeassistant
    image: "ghcr.io/home-assistant/home-assistant:stable"
    volumes:
      - /PATH_TO_YOUR_CONFIG:/config
      - /etc/localtime:/etc/localtime:ro
      - /run/dbus:/run/dbus:ro
    restart: unless-stopped
    privileged: true
    network_mode: host

configuration.ymal:


# 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:
  base_url: https://ha.my.domain
  use_x_forwarded_for: true
  trusted_proxies: 
    - 127.0.0.1
    - 172.0.0.0/24
    - 192.168.0.30
    - ::1

Caddy2:
host in PiOS (not in docker)

# Home Assistant
ha.my.domian {
	reverse_proxy localhost:8123
	import my.domain (this is for CloudFlare Acme Token)
	import log HomeAssistant
	import server-header-remove
}

Which error I got when I login using ha.my.domain:

記錄器: homeassistant.components.http.ban
來源: components/http/ban.py:136
整合: HTTP (相關文件, 問題)
首次發生: 23:05:48 (3 次出現)
最後紀錄: 23:09:44

Login attempt or request with invalid authentication from 172.70.214.219 (172.70.214.219). Requested URL: '/auth/login_flow/bc65488d64db7a357dac8bf22ab13b85'. (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36)
Login attempt or request with invalid authentication from 172.70.214.108 (172.70.214.108). Requested URL: '/auth/login_flow/0766b5c94689abcb1dfeca9d97bca1ad'. (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36)
Login attempt or request with invalid authentication from 172.70.214.143 (172.70.214.143). Requested URL: '/auth/login_flow/2436edd5a3b8f64d5bce2105deae919f'. (Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36)

any idea to fix this? still doesn’t know how to fix this :frowning:

1 Like