nginx Reverse Proxy for Pihole

Started by bscheller, February 06, 2021, 10:25:07 PM

Previous topic - Next topic
Hello All,

Just starting a journy with OPNsense and I am trying to replicate some functionality that was working in my prior implementation.  I am currently attempting to get nginx working as a reverse proxy to a Pihole instance using Let's Encrypt SSL certs.  Currently, when I hit pihole.my.domain I am getting part of the output from Pihole but only the html is loading.  The css and js are returning 404 errors. 

I have changed the port for OPNsense GUI so that 80 and 443 are available for nginx.  I have dynamic DNS working so that pihole.my.domain resolves to my WAN IP.  The Let's Encrypt Cert has pihole.my.domain listed in Alt Names and currently shows a status of OK and was retrieved earlier this week.  Pihole is accessible at the http://[IP Address of Pihole box]/admin.

Here is my configuration:

Upstream Server
  Name: Pihole
  IP: IP address of pihole box
  Port: 80
  Server Priority: 1

Upstream
  Server Entries: Pihole
  Load Balancing Algorithm: Weighted Round Robin

Location
  URL Pattern: /
  Match Type: None
  URL Rewriting: Nothing
  Upstream Servers: Pihole
  Path Prefix: /admin

HTTP Server
  HTTP Listen Port: 80
  HTTPS Listen Port: 443
  Server Name: pihole.my.domain
  TLS Certificate: Let's Encrypt Cert
  Client CA Certificate: Fake LE Intermediate X1
  Enable Let's Encrypt Support: Checked
  HTTPS Only: Checked

Can anyone point out what I have configured incorrectly or provide any other pointers?

Thanks for your time!

Brian Scheller
OPNsense 21.1
Protectli FW6E
Brian Scheller
Running OPNSense on Protectli FW6E

February 06, 2021, 11:25:17 PM #1 Last Edit: February 08, 2021, 07:08:03 PM by astromeier
Hi!
Maybe the Path Prefix: /admin is misleading...
As far as I know pihole is redirecting automagically to /admin, so try "/" as prefix...
Stay secure!
Thomas

OPNsense 22.x / Qotom Q370G4 ram8G ssd256G