添加 docs/nginx.mdx

This commit is contained in:
2025-10-19 21:37:10 +08:00
commit f2879bd937

21
docs/nginx.mdx Normal file
View File

@@ -0,0 +1,21 @@
# 使用nginx配置有一个域名问题
一直配置域名访问失败,不能访问,加端口才能正常访问
homeassisant的home-assisatant.log的错误信息是
```
ERROR (MainThread) [homeassistant.components.http.forwarded] Received X-Forwarded-For header from an untrusted proxy 192.168.65.1
```
修改的办法, 在`trusted_proxies`添加信任的的ip地址比如`192.168.65.1`
```sh
http:
use_x_forwarded_for: true
trusted_proxies:
- 127.0.0.1
- 192.168.65.1 # ✅ 加上这个 IP
ip_ban_enabled: true
login_attempts_threshold: 5
```