检查nginx设置,传递真实ip
location /
{
proxy_pass http://127.0.0.1:1080/; # 你的地址
proxy_redirect / /;
proxy_cookie_path / /;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /dns-query
{
proxy_pass http://127.0.0.1:1080; # 你的地址
proxy_bind 127.0.0.1;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
进入docker,编辑配置文件
sudo docker exec -it adguardhome /bin/bash
cd /opt/adguard/config
vi AdGuardHome.yaml
在配置文件的trusted_proxies中添加
trusted_proxies:
- 127.0.0.0/8
- ::1/128
- 172.17.0.0/24 # 根据实际情况更改