目前,我已经在Ubuntu20.04VPS中安装了皮孔(v5.12.2)。我已经在TLS上安装了Nginx作为DNS的反向代理,它工作得很好,但是由于Nginx没有转发每个客户端的实际IP,在Pihole中的日志中,一切都显示为127.0.0.1。
这是我目前的配置:
upstream dns-servers
{
server 127.0.0.1:53;
}
server {
listen 853 ssl;
ssl_certificate /etc/letsencrypt/live/domainname.here/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/domainname.here/privkey.pem;
ssl_protocols TLSv1.2 TLSv1.3;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_handshake_timeout 10s;
ssl_session_cache shared:SSL:20m;
ssl_session_timeout 4h;
proxy_pass dns-servers;
proxy_responses 1;
proxy_timeout 1s;
}如果我试图为proxy_set_header或real_ip_header添加一个指令,就会得到消息directive is not allowed here。我还试着使用这个指令 proxy_bind $remote_addr transparent;,虽然它被接受了,但是它会导致每个请求都超时。
什么是正确的方式来转发一个客户端的真实IP,这样它才能被Pihole正确地接收到?
发布于 2022-10-05 17:32:28
在nginx server上下文中添加log_guessed_client_ip = true,在pi-孔doh-server.conf中添加log_guessed_client_ip = true。
https://stackoverflow.com/questions/73962060
复制相似问题