The reverse_proxy
module doesn’t do simultaneous rewrites, so that config wouldn’t work. You need to use the rewrite
handler if you need to add a prefix before proxying.
Try this:
*.website.com {
rewrite * /{labels.2}{uri}
reverse_proxy 127.0.0.1:3000
}
Also, keep in mind that to use a wildcard certificate, you need to enable the DNS challenge (which involves building Caddy with a DNS plugin, etc):