summaryrefslogtreecommitdiff
path: root/modules/caddyhttp/app.go
diff options
context:
space:
mode:
Diffstat (limited to 'modules/caddyhttp/app.go')
-rw-r--r--modules/caddyhttp/app.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/modules/caddyhttp/app.go b/modules/caddyhttp/app.go
index 670185a..ceb62f4 100644
--- a/modules/caddyhttp/app.go
+++ b/modules/caddyhttp/app.go
@@ -232,6 +232,11 @@ func (app *App) Provision(ctx caddy.Context) error {
srv.trustedProxies = val.(IPRangeSource)
}
+ // set the default client IP header to read from
+ if srv.ClientIPHeaders == nil {
+ srv.ClientIPHeaders = []string{"X-Forwarded-For"}
+ }
+
// process each listener address
for i := range srv.Listen {
lnOut, err := repl.ReplaceOrErr(srv.Listen[i], true, true)