Command-line host argument?

Hey everyone, I want to straight-up proxy a site but I don’t want to create a Caddyfile for that. Is there a way to do this in the commandline?

caddy myhost { proxy / otherhost }

My current efforts have kept failing…

You can use the short Caddyfile syntax. It’s not designed for very complex Caddyfiles, but may still come in handy:

$ caddy -host="myhost" "proxy / otherhost"
1 Like

Thanks Matt, I wasn’t sure how to get the host in there (and it’s not immediately obvious from that section in the docs either).

Right, you have to use the command line flag (or -port to change the port), as the short Caddyfile syntax assumes just a single host.

1 Like

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