summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Holt <mholt@users.noreply.github.com>2020-12-09 13:06:57 -0700
committerMatthew Holt <mholt@users.noreply.github.com>2020-12-09 13:07:11 -0700
commitb8a799df9f58cf3ccc2577a37c2b561d2a3e72bd (patch)
treea8fe5b1963234ba875d2cd3152f1dfe68f28daab
parenta748151666ee442beca7a8756598bbf74d7f2aa4 (diff)
caddyhttp: Document that remote_ip reads X-Forwarded-For header
https://caddy.community/t/remote-ip-behaviour/10762?u=matt
-rw-r--r--modules/caddyhttp/matchers.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/modules/caddyhttp/matchers.go b/modules/caddyhttp/matchers.go
index 4886ba6..b9ddc33 100644
--- a/modules/caddyhttp/matchers.go
+++ b/modules/caddyhttp/matchers.go
@@ -105,6 +105,9 @@ type (
MatchProtocol string
// MatchRemoteIP matches requests by client IP (or CIDR range).
+ // If the X-Forwarded-For header is set, the first IP in that list
+ // is used as the reference IP; otherwise, the remote IP of the
+ // connection is the reference.
MatchRemoteIP struct {
Ranges []string `json:"ranges,omitempty"`