@marcel91200 / caddy Mirror · read-only / commits / ab32440b
Fork 0

Fast and extensible multi-platform HTTP/1-2-3 web server with automatic HTTPS

Mirrored from https://github.com/Slazee/caddy.git

Synced Nov 14, 05:15 UTC

httpcaddyfile: Add shortcut for proxy hostport placeholder (#4263)

* httpcaddyfile: Add shortcut for proxy hostport placeholder I've noticed that it's a pretty common pattern to write a proxy like this, when needing to proxy over HTTPS: ``` reverse_proxy https://example.com { header_up Host {http.reverse_proxy.upstream.hostport} } ``` I find it pretty hard to remember the exact placeholder to use for this, and I continually need to refer to the docs when I need it. I think a simple fix for this is to add another Caddyfile placeholder for this one to shorten it: ``` reverse_proxy https://example.com { header_up Host {proxy_hostport} } ``` * Switch the shortcut name

Francis Lavoie committed Aug 12, 2021 at 14:08 UTC ab32440b2121c5a8cf36e1eea1b7347f0386c2dc
1 file changed +1
caddyconfig/httpcaddyfile/httptype.go
+1
@@ -113,6 +113,7 @@ func (st ServerType) Setup(inputServerBlocks []caddyfile.ServerBlock,
113 "{tls_client_serial}", "{http.request.tls.client.serial}",
114 "{tls_client_subject}", "{http.request.tls.client.subject}",
115 "{tls_client_certificate_pem}", "{http.request.tls.client.certificate_pem}",
116 + "{upstream_hostport}", "{http.reverse_proxy.upstream.hostport}",
117 )
118
119 // these are placeholders that allow a user-defined final