summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modules/caddyhttp/replacer.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/modules/caddyhttp/replacer.go b/modules/caddyhttp/replacer.go
index 11f3bdb..57bc880 100644
--- a/modules/caddyhttp/replacer.go
+++ b/modules/caddyhttp/replacer.go
@@ -79,6 +79,12 @@ func addHTTPVarsToReplacer(repl caddy.Replacer, req *http.Request, w http.Respon
key := fmt.Sprintf("http.request.host.labels.%d", len(hostLabels)-i-1)
m[key] = label
}
+
+ pathParts := strings.Split(req.URL.Path, "/")
+ for i, label := range pathParts {
+ key := fmt.Sprintf("http.request.uri.path.%d", i)
+ m[key] = label
+ }
}
if w != nil {