Adding excludeHosts config option allowing for host based exclusions#3
Open
WolverinDEV wants to merge 2 commits intoDesuuuu:masterfrom
Open
Adding excludeHosts config option allowing for host based exclusions#3WolverinDEV wants to merge 2 commits intoDesuuuu:masterfrom
excludeHosts config option allowing for host based exclusions#3WolverinDEV wants to merge 2 commits intoDesuuuu:masterfrom
Conversation
Desuuuu
requested changes
Jan 18, 2026
| return nil | ||
| } | ||
|
|
||
| func getHost(req *http.Request) string { |
Owner
There was a problem hiding this comment.
I think it would make sense for this function to behave in a similar way as Traefik does internally.
Here's the relevant code: https://github.com/traefik/traefik/blob/master/pkg/middlewares/requestdecorator/request_decorator.go#L38
In short, they call the parseHost function, then strings.TrimSpace and strings.ToLower (see here).
| TrustedCIDRs []string `json:"trustedCIDRs,omitempty"` | ||
| RefreshInterval string `json:"refreshInterval,omitempty"` | ||
| OverwriteForwardedFor bool `json:"overwriteForwardedFor,omitempty"` | ||
| ExcludeHosts []string `json:"excludeHosts,omitempty"` |
Owner
There was a problem hiding this comment.
Naming the field/option ExcludedHosts/excludedHosts would be more consistent.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR introduces a new
excludeHostsconfiguration option.This option allows specific hostnames to bypass the Cloudflare origination check.
By enabling host-based exclusions, this change makes it possible to register the plugin globally as a middleware on an entrypoint while still permitting certain non-proxied domains to operate normally. This avoids the need to attach the middleware individually for each router or domain, greatly simplifying setups that mix Cloudflare-proxied and non-proxied hosts.
Key benefits: