Edit: This thread is from early in Caddy 2’s beta cycle, before it was even released. Caddy 2’s default behavior is to pass all headers through to the backend without modification, including setting/augmenting the X-Forwarded-For header for you. Basically, in Caddy 2, “transparent” is the default mode of operation. You do not need to set the headers like you did in v1 unless your backend app has specific/unconventional requirements.
Yeah, before we reach 2.0 stable I’ll be sure to go back and add more shorthand placeholders for the Caddyfile. Right now you have to use their full name for some of them.
Edit: To clarify, for anyone finding this later: there is no “transparent” preset in Caddy 2 because Caddy 2 passes the Host header thru by default already. It also adds X-Forwarded-For automatically. If you need any other headers set, you can do so with header_up.
It can use HTTP/2, but HTTP/2 requires HTTPS, so make sure to enable HTTPS to your backends. In your HTTP transport, define at least: "tls": {} (or for the Caddyfile, use the tls subdirective in your HTTP transport.)
Moderator edit: This thread got a lot of hits but contains outdated information from very early in the beta cycle of Caddy v2. It has been removed here to avoid confusing searchers. Please refer to current documentation instead: