1. The problem I’m having:
No problem as such, I’m looking for some advice on the best approach for this and whether what I’m attempting to do is even possible with Caddy.
I’m looking to build a service that reverse proxies a wildcard subdomain to dynamic upstreams. For example, I have multiple apps running on multiple servers, all apps are served using Caddy but I want to be able to hit: *.ap.viz.co
, for this example we will use one.ap.viz.co
and I want that to be able to reverse proxy to an app on server 1, then if I hit two.ap.viz.co
it is reversed proxied to server 2, etc.
I’m looking to setup the wildcard on a separate server so that I can have one DNS record for the wildcard that points at the proxy server and then that proxies to each individual server dependent on the subdomain.
I’m able to setup Caddy for each app on each server and setup the on_demand_tls for the wildcard subdomain, however I’m unsure how to setup the dynamic upstreams. Or whether this is a recommended approach.
2. Error messages and/or full log output:
PASTE OVER THIS, BETWEEN THE ``` LINES.
Please use the preview pane to ensure it looks nice.
N/A
3. Caddy version:
v2.7.6 h1:w0NymbG2m9PcvKWsrXO6EEkY9Ru4FJK8uQbYcev1p3A=
4. How I installed and ran Caddy:
Installed using Homebrew on local machine, but using apt
on servers.
a. System environment:
MacOS and Ubuntu