From e56bd27c1eb2053b688c9a51c7e6804f88438faa Mon Sep 17 00:00:00 2001 From: Timo Reimann Date: Thu, 2 Mar 2017 02:04:13 +0100 Subject: [PATCH 1/3] Remove blank space. --- docs/basics.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/basics.md b/docs/basics.md index 79042790e..d70c7ddb6 100644 --- a/docs/basics.md +++ b/docs/basics.md @@ -85,7 +85,7 @@ Frontends can be defined using the following rules: - `PathStrip`: Same as `Path` but strip the given prefix from the request URL's Path. - `PathPrefix`: PathPrefix adds a matcher for the URL path prefixes. This matches if the given template is a prefix of the full URL path. - `PathPrefixStrip`: Same as `PathPrefix` but strip the given prefix from the request URL's Path. -- `AddPrefix` : Add prefix from the request URL's Path. +- `AddPrefix`: Add prefix from the request URL's Path. You can use multlple values for a rule by separating them with `,`. You can use multiple rules by separating them by `;`. From 6942b063eefcb9bf9ea5aa92ba593df4cd6d5d6f Mon Sep 17 00:00:00 2001 From: Timo Reimann Date: Thu, 2 Mar 2017 02:10:47 +0100 Subject: [PATCH 2/3] Motivate and explain regular expression rules. --- docs/basics.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/basics.md b/docs/basics.md index d70c7ddb6..7595851fd 100644 --- a/docs/basics.md +++ b/docs/basics.md @@ -92,6 +92,10 @@ You can use multiple rules by separating them by `;`. You can optionally enable `passHostHeader` to forward client `Host` header to the backend. +In order to use path regular expressions, you must declare an arbitrarily named variable followed by the colon-separated regular expression, all enclosed in curly braces. Any pattern supported by [Go's regexp package](https://golang.org/pkg/regexp/) may be used. Example: `/posts/{id:[0-9]+}`. + +(Note that the variable has no special meaning; however, it is required by gorilla/mux which embeds the regular expression and defines the syntax.) + Here is an example of frontends definition: ```toml From 7d20871f0d7dc54a51261d2f287a42f01268abfa Mon Sep 17 00:00:00 2001 From: Timo Reimann Date: Fri, 3 Mar 2017 00:27:33 +0100 Subject: [PATCH 3/3] Fix typos. --- docs/basics.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/basics.md b/docs/basics.md index 7595851fd..787604451 100644 --- a/docs/basics.md +++ b/docs/basics.md @@ -85,9 +85,9 @@ Frontends can be defined using the following rules: - `PathStrip`: Same as `Path` but strip the given prefix from the request URL's Path. - `PathPrefix`: PathPrefix adds a matcher for the URL path prefixes. This matches if the given template is a prefix of the full URL path. - `PathPrefixStrip`: Same as `PathPrefix` but strip the given prefix from the request URL's Path. -- `AddPrefix`: Add prefix from the request URL's Path. +- `AddPrefix`: Add prefix to the request URL's Path. -You can use multlple values for a rule by separating them with `,`. +You can use multiple values for a rule by separating them with `,`. You can use multiple rules by separating them by `;`. You can optionally enable `passHostHeader` to forward client `Host` header to the backend.