From d242f10eda8fdd52f86701cf3685090e9761489f Mon Sep 17 00:00:00 2001 From: Matthew Holt Date: Tue, 27 Aug 2019 14:38:24 -0600 Subject: Add query_string to HTTP replacer and use it for try_files --- modules/caddyhttp/replacer.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'modules/caddyhttp/replacer.go') diff --git a/modules/caddyhttp/replacer.go b/modules/caddyhttp/replacer.go index cc29789b0..9a8a875e5 100644 --- a/modules/caddyhttp/replacer.go +++ b/modules/caddyhttp/replacer.go @@ -89,6 +89,12 @@ func addHTTPVarsToReplacer(repl caddy.Replacer, req *http.Request, w http.Respon return dir, true case "http.request.uri.query": return req.URL.RawQuery, true + case "http.request.uri.query_string": + qs := req.URL.Query().Encode() + if qs != "" { + qs = "?" + qs + } + return qs, true } // hostname labels -- cgit v1.2.3