如何暴力的设置Home Assistant的反向代理(解决Home Assistant反向代理的各种问题)
2025年2月8日约 213 字小于 1 分钟
在设置 Home Assistant 的反向代理后很容易遇到400: Bad Request
或者Unable to connect to Home Assistant.
的问题,经过我研究后找到了一个完美且暴力的方案,就是放行所有 IP 地址。
在<Home Assistant目录>/config/configuration.yaml
里添加这么一段内容并重启 Home Assistant.
http:
use_x_forwarded_for: true
trusted_proxies:
- 0.0.0.0/0

以下是试错记录
当配置完反向代理之后,Home Assistant 反向代理后的页面报错400: Bad Request
.

然后我修改了configuration.yaml
为以下内容,可以进去了,但是登陆后无法进入。
http:
use_x_forwarded_for: true
trusted_proxies:
- 192.168.0.0/16
- 127.0.0.1

最后直接开放所有 IP,终于解决问题。
(我真是个天才)