Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to patch proxy config in Caddy #1031

Closed
ravikhetani opened this issue Apr 3, 2024 · 0 comments · Fixed by #1033
Closed

Add ability to patch proxy config in Caddy #1031

ravikhetani opened this issue Apr 3, 2024 · 0 comments · Fixed by #1033

Comments

@ravikhetani
Copy link
Contributor

ravikhetani commented Apr 3, 2024

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.

@ravikhetani ravikhetani changed the title Add ability to patch reverse proxy directive in Caddy Add ability to patch proxy config in Caddy Apr 17, 2024
@DawoudSheraz DawoudSheraz linked a pull request Apr 25, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging a pull request may close this issue.

2 participants