I’m trying to force Caddy to listen on a specific IP (59.161.27.119) and forward requests to another IP (59.161.27.120 …which actually serves the sites) by generating Let’s Encrypt certificates for them.
My Caddyfile is like:
59.161.27.119:80 my.website.com {
proxy / 59.161.27.120:80
}
and I get a Parse error: Unknown directive ‘my.website.com’.
I’m clearly making a logical error, yet, I couldn’t find out how to implement that.
Caddy is trying to process my.website.com as a directive for 59.161.27.119:80. My hunch is that this is because the first line in the Caddyfile is a site address (good) but doesn’t open a directive block (making Caddy think the rest of the file is flat and contains only directives for the site).