I have Caddy Version v2.1.1
My setup: I have a Raspberry Pi 4 (Running on Raspberry OS version buster) and on there I am running Caddy, Adguard Home (A DNS Service), and Wireguard. I also have a QNAP server which I have apps running on different ports. I am able to use Caddy to reverse proxy my domain paths to the different applications on my QNAP server, so that is all good (unless anyone has any better suggestions for my Caddyfile which I have shared below).
Caddyfile:
mydomain.com {
reverse_proxy /radarr* 192.168.80.120:7878
reverse_proxy /sonarr* 192.168.80.120:8989
reverse_proxy /sabnzbd* 192.168.80.120:8282
reverse_proxy /ombi* 192.168.80.120:8976
reverse_proxy /tautulli* 192.168.80.120:8660
}
192.168.80.131 {
reverse_proxy /* 192.168.80.131:88
# redir http://192.168.80.131:88
}
My problem lies with setting up AdGuard home correctly. I have dedicated Port 80 to be setup with Caddy. Usually AdGuard Home would also be setup with Port 80, but I figured I can setup Adgurad Home at port 88 and use Caddy to take connections coming in to port 80 and point it to port 88. This way I can still use the Raspberry’s IP as my DNS IP address while still reserving Port 80 for Caddy. As you can see in my Caddyfile I am unsure if I should be using a “reverse_proxy” or a “redir”.
The problems I have found: With “redir”, when I go to the IP address of my Raspberry Pi, the URL changes to “192.168.80.131:88”, and I am unsure if that is appropriate for DNS servers. And, when I use “reverse_proxy”, I also get taken to the Adguard Home Dashboard, but there are SSL Cert issues on the Chrome browser.
So I am wondering if I am doing this correctly or is there a way to turn off the need to check for SSL for local IP addresses.
To run Caddy, I am using “sudo caddy run --watch”. On Reboots, I have the system run “sudo caddy start --config /home/ktron/Caddyfile” (If anyone has a better way to reboot and have caddy know where the Caddyfile is, please let me know as I am just using @reboot)
Here are some of the errors I have been getting:
2020/08/12 12:53:33 http: TLS handshake error from 192.168.80.115:50682: remote error: tls: unknown certificate
2020/08/12 12:53:41 http: TLS handshake error from 192.168.80.115:50691: remote error: tls: unknown certificate
I have already tried replacing the Raspberry Pi’s IP address in the Caddyfile with “localhost” for both reverse_proxy and redir and for the to and from portion of the file.