Access Pihole via NPM

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:

    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.

  12. 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.