Skip to content

Commit

Permalink
make docs more clear and add links from reference to tutorial (#1138)
Browse files Browse the repository at this point in the history
* make docs more clear and add links from reference to tutorial

Signed-off-by: Sandor Szücs <[email protected]>

* make also #992 more clear

Signed-off-by: Sandor Szücs <[email protected]>
  • Loading branch information
szuecs authored and aryszka committed Jul 26, 2019
1 parent f46148e commit e98e09f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
4 changes: 2 additions & 2 deletions docs/kubernetes/ingress-usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ zalando.org/skipper-filter | `consecutiveBreaker(15)` | arbitrary filters
zalando.org/skipper-predicate | `QueryParam("version", "^alpha$")` | arbitrary predicates
zalando.org/skipper-routes | `Method("OPTIONS") -> status(200) -> <shunt>` | extra custom routes
zalando.org/ratelimit | `ratelimit(50, "1m")` | deprecated, use zalando.org/skipper-filter instead
zalando.org/skipper-ingress-redirect | `true` | change the default HTTPS redirect behavior for specific ingresses (true/false)
zalando.org/skipper-ingress-redirect | `"true"` | change the default HTTPS redirect behavior for specific ingresses (true/false)
zalando.org/skipper-ingress-redirect-code | `301` | change the default HTTPS redirect code for specific ingresses
zalando.org/skipper-loadbalancer | `consistentHash` | defaults to `roundRobin`, [see available choices](../../reference/backends/#load-balancer-backend)

Expand Down Expand Up @@ -998,7 +998,7 @@ Example:
kind: Ingress
metadata:
annotations:
zalando.org/skipper-ingress-redirect: true
zalando.org/skipper-ingress-redirect: "true"
zalando.org/skipper-ingress-redirect-code: 301
name: app
spec:
Expand Down
4 changes: 3 additions & 1 deletion docs/reference/filters.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,11 @@ Parameters:
Example:

```
redir: PathRegex(/^\/foo\/bar/) -> redirectTo(302, "/foo/newBar") -> <shunt>;
redirect: PathRegex(/^\/foo\/bar/) -> redirectTo(302, "/foo/newBar") -> <shunt>;
```

see also [redirect-handling](../tutorials/common-use-cases.md#redirect-handling)

## redirectToLower

Same as [redirectTo](#redirectTo), but replaces all strings to lower case.
Expand Down
14 changes: 13 additions & 1 deletion docs/tutorials/common-use-cases.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ Example:
< Content-Length: 0
<
* Connection #0 to host localhost left intact
```

#### set absolute path
Expand Down Expand Up @@ -84,6 +83,19 @@ specified path by the client should be appended to this base path you
can use the `modPath` filter just before the `redirectTo()` to modify
the base path as you like.

Route Example shows, that calls to `/a/base/foo/bar` would be
redirected to `https://another-example.com/my/new/base/foo/bar`:

```
redirect: Path("/a/base/")
-> modPath("/a/base/", "/my/new/base/")
-> redirectTo(308, "https://another-example.com")
-> <shunt>'
```

The next example shows how to test a redirect with changed base path
on your computer:

```
% ./bin/skipper -address :8080 -inline-routes 'r: * -> modPath("/", "/my/new/base/") -> redirectTo(308, "http://127.0.0.1:9999") -> <shunt>'
::1 - - [01/Nov/2018:18:49:45 +0100] "GET /foo HTTP/1.1" 308 0 "-" "curl/7.49.0" 0 localhost:8080 - -
Expand Down

0 comments on commit e98e09f

Please sign in to comment.