在configuraiton.yaml添加
http:
# Cloudflare setting to unlock reverse proxy
use_x_forwarded_for: true
trusted_proxies:
- 192.168.0.109
https://community.home-assistant.io/t/issue-with-nginx-reverse-proxy-setup-external-access/321776/8
# Uncomment this if you are using SSL/TLS, running in Docker container, etc.
http:
ip_ban_enabled: true
login_attempts_threshold: 5
use_x_forwarded_for: true
trusted_proxies:
- 172.30.33.0/24
取而代之的是:
# Uncomment this if you are using SSL/TLS, running in Docker container, etc.
http:
ip_ban_enabled: true
login_attempts_threshold: 5
use_x_forwarded_for: true
trusted_proxies:
- 172.30.33.0/24
实践解决如下:
nano /usr/share/hassio/homeassistant/configuration.yaml
# 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:
ip_ban_enabled: true
use_x_forwarded_for: true
trusted_proxies:
- 192.168.0.0/24
- 127.0.0.1
- 172.16.0.0/12
- 172.30.33.0/24
- 172.30.32.0/23