Combine multiple webinterfaces to 1 by caddy

I’ve red a lot of the Caddy documentation in one sitting and now I don’t know anything again ^^To me more precise- I’m just more confused then before.

1. Caddy version (caddy version):

2.4.5

2. How I run Caddy:

http://192.168.178.20:80 {
reverse_proxy localhost:1080
}

a. System environment:

Raspi 4 with Debian 11, latest updates including dot.net (Kestrel) + lighttpd
running without any docker
I run a Raspi 4 with a few web services.
1. ArchiSteamFarm (Kestrel integrated, listening at port 1242)
2. Pihole (Lighttpd integrated, listening at port 1080)
3. Octoprint (without inbuild server software)

3. The problem I’m having:

I thought I could just create a start page, and let caddy redirect to the subpages with https encription.

But I never succeeded in running even 2 services accessible by caddy at the same time.

  • I want 1 Start page (Including footer for quick switch)
  • All 3 services should be accessible in 192.168.. only as security measure (local network only)
  • All 3 services should have a separate subdomain each (f. e. “caddy.asf” or “192.168.178.19/pihole/admin”)
  • Each service should have a legit https certificate to avoid annoying warnings

Is there any way to achieve that with caddy? How? I hope you can lead the way for me, because I’m lost right now :confused:

I only succeeded in using a caddy reverse proxy for 1 service yet, to avoid port conflicts between caddy with lighttpd- which doesn’t make sense yet for 1 service only, especially since I’m struggling with the certification aswell.

I also don’t know PHP- I can only write some simple HTML =/

5. What I already tried:

checking the documentation left me confused and lost on my way to solution :confused:
setting up multiple reverse proxy from port 80 of the same IP to different services failed ofc :confused:

6. Links to relevant resources:

I think this guide might be a good starting point for you:

Additional points:

  • Subdomains are much better than proxying to subpaths, because many apps don’t behave well when you try to serve them in a subpath. Read more about that here: The "subfolder problem", OR, "why can't I reverse proxy my app into a subfolder?"

  • You probably don’t need the IP address access. Since you’re using Pihole, you have a DNS server, and you can set up local names for each service, or you can make your real domains resolve to a LAN IP address while inside of your network (while devices outside your network would use the WAN IP by resolving using public DNS servers)

  • Read through the Caddyfile structure docs Caddyfile Concepts — Caddy Documentation Essentially, you want to make a site block for each site you want to proxy to.

3 Likes

This topic was automatically closed after 30 days. New replies are no longer allowed.