HomeAssistant反向代理后访问出现400 BadRequest处理

为了安全起见,给HomeAssistant配置反向代理,在确保SSL证书和Nginx的反向代理配置没有问题后,访问HTTPS的URL地址后,会出现400 BadRequest的问题。

查看logs后发现系统提示

2021-12-26 23:55:17 ERROR (MainThread) [homeassistant.components.http.forwarded] A request from a reverse proxy was received from 192.168.123.XXX, but your HTTP integration is not set-up for reverse proxies

大概的意思是需要配置下反向代理服务器的地址,应该是为了安全,但这在之前的几个版本里并不存在相关的配置——坑

搜索下,有位大佬给了解决方案,链接在此:【新提醒】升级到2021.7后外网打不开web页面的解决方法 - 『HomeAssistant』综合讨论区 - 『瀚思彼岸』» 智能家居技术论坛 - Powered by Discuz! (hassbian.com)

非常感谢分享

http:
use_x_forwarded_for: true
trusted_proxies:
- 192.168.123.0/24 # Add the IP address of the proxy server

重启容器后可正常访问https的地址。

Related Posts

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注