Like this:
app1.example.com {
reverse_proxy 192.168.1.10:8001
}
app2.example.com {
reverse_proxy 192.168.1.10:8002
}
I’ve never heard of this term before
It says “connected”, so no. Was your firewall allowing the connection but preventing traffic, or something?
You have :
in there after the domains. Remove that.
Yes, this uses the incoming request’s Host there.
You can either just explicitly write https://caddytest.cf{uri}
or use labels placeholders like https://{labels.1}.{labels.0}{uri}
where a label is the segments of the hostname starting from the right.
We have an example in the docs that shows how to do this (but while typing this up I realized there was a small mistake, the .
was missing between the label placeholders – fixing it here docs: Changes for v2.5.1 release by francislavoie · Pull Request #228 · caddyserver/website · GitHub):
Depends. You might need try_files
if your site is JS with a frontend router (react-router or something), and probably should enable encode gzip
for compression. You might need CORS headers depending on what you’re doing, etc. It’s all very usecase-specific.
You’re talking about a TCP proxy – Caddy’s default build doesn’t do this, because it’s an HTTP layer proxy.
You can use GitHub - mholt/caddy-l4: Layer 4 (TCP/UDP) app for Caddy if you need a TCP/UDP proxy.