summaryrefslogtreecommitdiff
path: root/modules/caddyhttp/rewrite/caddyfile.go
diff options
context:
space:
mode:
authorMatthew Holt <mholt@users.noreply.github.com>2020-01-11 13:47:42 -0700
committerMatthew Holt <mholt@users.noreply.github.com>2020-01-11 13:47:42 -0700
commit25dea2903e613534e00a2a4e305e0c8f2daeea8d (patch)
treea1dabd4ffa5a277adea31ee309f246be0baf6ff7 /modules/caddyhttp/rewrite/caddyfile.go
parentd876de61e512db7a31a7ae59723d5134048f283e (diff)
http: A little more polish on rewrite handler and try_files directive
Diffstat (limited to 'modules/caddyhttp/rewrite/caddyfile.go')
-rw-r--r--modules/caddyhttp/rewrite/caddyfile.go7
1 files changed, 4 insertions, 3 deletions
diff --git a/modules/caddyhttp/rewrite/caddyfile.go b/modules/caddyhttp/rewrite/caddyfile.go
index 368db15..6ec51c0 100644
--- a/modules/caddyhttp/rewrite/caddyfile.go
+++ b/modules/caddyhttp/rewrite/caddyfile.go
@@ -32,7 +32,8 @@ func init() {
//
// rewrite [<matcher>] <to>
//
-// The <to> parameter becomes the new URI.
+// Only URI components which are given in <to> will be set in the resulting URI.
+// See the docs for the rewrite handler for more information.
func parseCaddyfileRewrite(h httpcaddyfile.Helper) (caddyhttp.MiddlewareHandler, error) {
var rewr Rewrite
for h.Next() {
@@ -58,7 +59,7 @@ func parseCaddyfileStripPrefix(h httpcaddyfile.Helper) (caddyhttp.MiddlewareHand
if !h.NextArg() {
return nil, h.ArgErr()
}
- rewr.StripPrefix = h.Val()
+ rewr.StripPathPrefix = h.Val()
if h.NextArg() {
return nil, h.ArgErr()
}
@@ -77,7 +78,7 @@ func parseCaddyfileStripSuffix(h httpcaddyfile.Helper) (caddyhttp.MiddlewareHand
if !h.NextArg() {
return nil, h.ArgErr()
}
- rewr.StripSuffix = h.Val()
+ rewr.StripPathSuffix = h.Val()
if h.NextArg() {
return nil, h.ArgErr()
}