From b8a799df9f58cf3ccc2577a37c2b561d2a3e72bd Mon Sep 17 00:00:00 2001 From: Matthew Holt Date: Wed, 9 Dec 2020 13:06:57 -0700 Subject: caddyhttp: Document that remote_ip reads X-Forwarded-For header https://caddy.community/t/remote-ip-behaviour/10762?u=matt --- modules/caddyhttp/matchers.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'modules/caddyhttp/matchers.go') 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"` -- cgit v1.2.3