Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the missing example in HTTP rewrite #3126

Merged
merged 3 commits into from
Jun 11, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ spec:
hostnames:
robscott marked this conversation as resolved.
Show resolved Hide resolved
- rewrite.example
rules:
- filters:
- matches:
- path:
type: PathPrefix
value: /cardamom
filters:
- type: URLRewrite
urlRewrite:
hostname: elsewhere.example
Expand Down
7 changes: 6 additions & 1 deletion site-src/guides/http-redirect-rewrite.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,14 @@ rewrite.example`.
Path rewrites also make use of HTTP Path Modifiers. The HTTPRoute below
will take request for `https://rewrite.example/cardamom/smidgen` and proxy a
request to `https://elsewhere.example/fennel` upstream to `example-svc`.

```yaml
{% include 'standard/http-redirect-rewrite/httproute-rewrite-full-path.yaml' %}
```

Instead using `type: ReplacePrefixMatch` and `replacePrefixMatch: /fennel` will
request `https://elsewhere.example/fennel/smidgen` upstream.

```yaml
{% include 'standard/http-redirect-rewrite/httproute-rewritepath.yaml' %}
{% include 'standard/http-redirect-rewrite/httproute-rewrite-prefix-path.yaml' %}
```