Skip to content

how to

Configure a reverse proxy, custom location and HTTPS for Pi-hole.

Before you begin
A running Pi-hole instance ยท Nginx Proxy Manager
On this page

Access Pi-hole via Nginx Proxy Manager

To add Pi-hole to Nginx Proxy Manager, you can follow these steps:

  1. Login to Nginx Proxy Manager: Open your web browser and navigate to your Nginx Proxy Manager dashboard.

  2. Add Proxy Host: Click on the "Proxy Hosts" tab on the left sidebar and then click the "Add Proxy Host" button.

  3. Configure Proxy Host:

  4. Domain Names: Enter pihole.domain.com where domain.com is the domain URL you wish to use.
  5. Scheme: Select http from the dropdown menu.
  6. Forward Hostname/IP: Enter IP for Pihole.
  7. Forward Port: Enter 80.
  8. Custom Locations: Leave this field empty.
  9. SSL: Check this box if you want to enable SSL.

  10. Advanced Configuration:

  11. In the "Advanced" section, add the following configuration:

Replace 192.168.68.107 with your Pi-hole's IP address in both proxy_pass directives below.

 ```nginx
 location / {
   proxy_pass http://192.168.68.107:80/admin/;
   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_hide_header X-Frame-Options;
   proxy_set_header X-Frame-Options "SAMEORIGIN";
   proxy_read_timeout 90;
 }
 location /admin {
   proxy_pass http://192.168.68.107:80/admin/;
   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_hide_header X-Frame-Options;
   proxy_set_header X-Frame-Options "SAMEORIGIN";
   proxy_read_timeout 90;
 }
 ```
 Replace `192.168.68.107` with the actual IP address of your Pi-hole server.
  1. SSL:

Requesting an SSL certificate via NPM

In the SSL tab, select Request a new SSL certificate and choose Let's Encrypt. Ensure your domain points to your NPM instance before requesting. For local-only domains, use DNS challenge instead.

  1. Save Changes: Click the "Save" button to apply the configuration.

Now, Nginx Proxy Manager should be set up to forward requests to Pi-hole at pihole.domainname.com. Make sure to adjust the domain name and IP address to match your setup.

Support Techdox on Buy Me a Coffee


If there is an issue with this guide or you wish to suggest changes, please raise an issue on GitHub.