overhangio/tutor

Add ability to patch proxy config in Caddy

ravikhetani opened this issue · 0 comments

Is your feature request related to a problem? Please describe.
We're trying to add a noindex response header to prevent search indexing, which would apply to the lms, cms, mfes etc, something like this:

`
(proxy) {
...
reverse_proxy {args.0} {
header_up X-Forwarded-Port {{ 443 if ENABLE_HTTPS else 80 }}
}

header X-Robots-Tag "noindex"

}
`

Describe the solution you'd like
Easiest way to do this would probably be to patch the proxy config in the caddyfile, but it seems like this is not possible currently as this patch is not available. Suggestion is to add a new patch

`(proxy) {
...
reverse_proxy {args.0} {
header_up X-Forwarded-Port {{ 443 if ENABLE_HTTPS else 80 }}
}

{{ patch("caddyfile-reverse-proxy")|indent(4) }}

}`

Additional context
Happy to take this on and submit a PR.