Listening on a specific IP and proxying requests


I’m trying to force Caddy to listen on a specific IP ( and forward requests to another IP ( …which actually serves the sites) by generating Let’s Encrypt certificates for them.

My Caddyfile is like: {
proxy /

and I get a Parse error: Unknown directive ‘

I’m clearly making a logical error, yet, I couldn’t find out how to implement that.

Thanks very much in advance for any help.

Caddy is trying to process as a directive for 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).

Try something like: {
} {
    proxy /

See the Caddyfile documentation, where it specifies expected syntax for Caddyfiles with multiple vhosts.

Thanks so much. That worked.

I also tried using with bind command and that worked too. Appreciate.

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.