-1

Why can't PiHole connect with my nginx reverse proxy? I log into https://dns.thearknet.me/admin and it defaults back to HTTP.

All of my other servers can get HTTPS using the Nginx server and certificate. Just not Pi-Hole.

I know it's just a setting issue that most people already know how to resolve. I have tried all the ones I could including changing location to /admin and adding additional flags. Here is my config. I do not know what relevant logs to check.

#DNS server { listen 80; server_name dns.thearknet.me; return 301 https://$host$request_uri; } server { listen 443 ssl; server_name dns.thearknet.me; ssl_certificate /etc/letsencrypt/live/thearknet.me/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/thearknet.me/privkey.pem; include /etc/letsencrypt/options-ssl-nginx.conf; ssl_dhparam /etc/letsencrypt/dhparams.pem; location / { proxy_pass http://10.0.1.2:80; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto https; proxy_set_header X-Forwarded-Host $server_name; add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always; } } 

Traditional log files don't exist

root@REVERSEPROXY:~# cat /var/log/nginx/access.log cat: /var/log/nginx/access.log: No such file or directory root@REVERSEPROXY:~# cat /var/log/nginx/error.log cat: /var/log/nginx/error.log: No such file or directory 

I reboot the server each time.

EDIT

I found the logs

cat /etc/nginx/nginx.conf 
2025/11/26 14:52:46 [warn] 289#289: could not build optimal proxy_headers_hash, you should increase either proxy_headers_hash_max_size: 512 or proxy_headers_hash_bucket_size: 64; ignoring proxy_headers_hash_bucket_size 2025/11/26 14:53:56 [warn] 228#228: could not build optimal proxy_headers_hash, you should increase either proxy_headers_hash_max_size: 512 or proxy_headers_hash_bucket_size: 64; ignoring proxy_headers_hash_bucket_size 2025/11/26 14:53:56 [warn] 289#289: could not build optimal proxy_headers_hash, you should increase either proxy_headers_hash_max_size: 512 or proxy_headers_hash_bucket_size: 64; ignoring proxy_headers_hash_bucket_size 

Added 2 lines to /etc/nginx/nginx.conf

proxy_headers_hash_max_size 1024; proxy_headers_hash_bucket_size 128; 

Rebooted. Nothing changes

PS C:\WINDOWS\System32> Invoke-Webrequest https://dns.thearknet.me 
Invoke-Webrequest : The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel. At line:1 char:1 + Invoke-Webrequest https://dns.thearknet.me + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebException + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand 
nginx -v nginx version: openresty/1.27.1.2 
6
  • I agree with the previous commentator that the redirect looks like it is being issued by the Pi-hole itself. Your environment is completely unclear. Are Pi-hole and the nginx reverse proxy running on different hosts? What Pi-hole version are you using? What's the nginx host OS? How was nginx installed on that host? What is the output of the nginx -V command? The question as a whole is off-topic on Server Fault (you might have better luck on Super User). Commented Nov 26 at 19:24
  • curl -I ask for a URI. I placed in the domain name but it says parameter cannot be found that matches parameter name. I installed nginx with a Proxmox VE helper script and updated everything to debian 13 before installing certbot. using nginx -v as a systemctl command is not working. Commented Nov 26 at 19:39
  • I updated my thread Commented Nov 26 at 20:01
  • 1
    I asked you for the nginx -V command output, not the nginx -v. I asked this to help you find the location of the nginx logs; it's not relevant anymore anyway since you've already found them (most likely in the /usr/local/openresty/nginx/logs directory since you are using OpenResty bundle rather than vanilla nginx). The PowerShell curl isn't curl at all; the output you've shown isn't of much help. Commented Nov 26 at 20:29
  • 1
    I am asking my self what an pi hole question has to do with an business administrator environment? looks for me straight off topic Commented Nov 27 at 10:34

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.