From 9c3a5f101ce54f82f07333418c765bf931d5c7c9 Mon Sep 17 00:00:00 2001 From: Youssef Bel Mekki <38552193+ybelMekk@users.noreply.github.com> Date: Wed, 13 Nov 2024 12:34:11 +0100 Subject: [PATCH] fix(redirect): how to MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Sindre Rødseth Hansen Co-authored-by: Carl Hedgren --- docs/workloads/application/how-to/redirect.md | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/docs/workloads/application/how-to/redirect.md b/docs/workloads/application/how-to/redirect.md index af8939e2..b6f0895f 100644 --- a/docs/workloads/application/how-to/redirect.md +++ b/docs/workloads/application/how-to/redirect.md @@ -4,14 +4,14 @@ tags: [ application, how-to, redirect ] # Redirect a client -To redirect traffic from one domain to another, you need to define an ingress for the old domain that redirects to the +To redirect traffic from one domain to another, you need to define an ingress `from` the old domain that redirects `to` the new domain, with [`.spec.redirects[]`](../reference/application-spec.md#redirects). The `redirects` field specifies URL redirects. It is structured as a mapping from a source URL to a target URL. A successful redirect will return a `302 Moved Temporarily` HTTP status code with location header set to the target URL. -!!! note "Status code" +??? note "Status code for redirects" The status code can not be overridden. ### Structure @@ -21,16 +21,16 @@ apiVersion: nais.io/v1alpha1 kind: Application spec: ingress: - - https://. + - https://. redirects: - from: https://. - to: https://. + to: https://. ``` ### Parameters -- **from**: *(string)* The source URL to be redirected. This is the URL where requests originate. -- **to**: *(string)* The target URL for the redirection. This is the URL where requests will be forwarded. +- **from**: *(string)* The source URL for the redirection. This is the URL that will be redirected. +- **to**: *(string)* The target URL for the redirection. This is the URL that the client will be redirected to. ### Usage Example @@ -39,17 +39,17 @@ apiVersion: nais.io/v1alpha1 kind: Application spec: ingress: - - https://example-old.com + - https://example-new.com redirects: - from: "http://example-old.nais.io" - to: "http://example.nais.io" + to: "http://example-new.nais.io" ``` -!!! warning "Redirect restrictions" +??? warning "Redirect restrictions" The `from` and `to` URLs must be valid URLs. - The `from` URL must be a valid URL that is exposed by the application. + The `to` URL must be a valid URL that is exposed by the application. In this example: -- Requests to `http://example-old.nais.io` are redirected to `http://example.nais.io`. \ No newline at end of file +- Requests to `http://example-old.nais.io` are redirected to `http://example-new.nais.io`. \ No newline at end of file