Skip to content

Commit

Permalink
add example to docs for dynamic rewrites
Browse files Browse the repository at this point in the history
  • Loading branch information
Zenara Daley committed Oct 4, 2018
1 parent 2d88171 commit 726fbc2
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions docs/examples/rewrite/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,33 @@ BODY:
-no body in request-
```

### Dynamic Rewrite Target

Create an Ingress rule with a rewrite annotation:

```console
$ echo "
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /$1
name: rewrite
namespace: default
spec:
rules:
- host: rewrite.bar.com
http:
paths:
- backend:
serviceName: http-svc
servicePort: 80
path: /something/(.+)
" | kubectl create -f -
```

In this case a request to `rewrite.bar.com/something/new` will redirect to `rewrite.bar.com/new`.

### App Root

Create an Ingress rule with a app-root annotation:
Expand Down

0 comments on commit 726fbc2

Please sign in to comment.