Rewrite ¶
This example demonstrates how to use Rewrite
annotations.
Prerequisites ¶
You will need to make sure your Ingress targets exactly one Ingress controller by specifying the ingress.class annotation, and that you have an ingress controller running in your cluster.
Deployment ¶
Rewriting can be controlled using the following annotations:
Name | Description | Values |
---|---|---|
nginx.ingress.kubernetes.io/rewrite-target | Target URI where the traffic must be redirected | string |
nginx.ingress.kubernetes.io/ssl-redirect | Indicates if the location section is only accessible via SSL (defaults to True when Ingress contains a Certificate) | bool |
nginx.ingress.kubernetes.io/force-ssl-redirect | Forces the redirection to HTTPS even if the Ingress is not TLS Enabled | bool |
nginx.ingress.kubernetes.io/app-root | Defines the Application Root that the Controller must redirect if it's in / context | string |
nginx.ingress.kubernetes.io/use-regex | Indicates if the paths defined on an Ingress use regular expressions | bool |
Examples ¶
Rewrite Target ¶
Attention
Starting in Version 0.22.0, ingress definitions using the annotation nginx.ingress.kubernetes.io/rewrite-target
are not backwards compatible with previous versions. In Version 0.22.0 and beyond, any substrings within the request URI that need to be passed to the rewritten path must explicitly be defined in a capture group.
Note
Captured groups are saved in numbered placeholders, chronologically, in the form $1
, $2
... $n
. These placeholders can be used as parameters in the rewrite-target
annotation.
Note
Please see the FAQ for Validation Of path
Create an Ingress rule with a rewrite annotation:
$ echo '
+ Rewrite - Ingress-Nginx Controller Ingress-Nginx Controller Rewrite
Rewrite ¶
This example demonstrates how to use Rewrite
annotations.
Prerequisites ¶
You will need to make sure your Ingress targets exactly one Ingress controller by specifying the ingress.class annotation, and that you have an ingress controller running in your cluster.
Deployment ¶
Rewriting can be controlled using the following annotations:
Name Description Values nginx.ingress.kubernetes.io/rewrite-target Target URI where the traffic must be redirected string nginx.ingress.kubernetes.io/ssl-redirect Indicates if the location section is only accessible via SSL (defaults to True when Ingress contains a Certificate) bool nginx.ingress.kubernetes.io/force-ssl-redirect Forces the redirection to HTTPS even if the Ingress is not TLS Enabled bool nginx.ingress.kubernetes.io/app-root Defines the Application Root that the Controller must redirect if it's in /
context string nginx.ingress.kubernetes.io/use-regex Indicates if the paths defined on an Ingress use regular expressions bool
Examples ¶
Rewrite Target ¶
Attention
Starting in Version 0.22.0, ingress definitions using the annotation nginx.ingress.kubernetes.io/rewrite-target
are not backwards compatible with previous versions. In Version 0.22.0 and beyond, any substrings within the request URI that need to be passed to the rewritten path must explicitly be defined in a capture group.
Note
Captured groups are saved in numbered placeholders, chronologically, in the form $1
, $2
... $n
. These placeholders can be used as parameters in the rewrite-target
annotation.
Note
Please see the FAQ for Validation Of path
Create an Ingress rule with a rewrite annotation:
$ echo '
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
diff --git a/sitemap.xml b/sitemap.xml
index 6b9c03da3..183f6b3aa 100644
--- a/sitemap.xml
+++ b/sitemap.xml
@@ -2,327 +2,327 @@
https://kubernetes.github.io/ingress-nginx/
- 2024-03-01
+ 2024-03-06
daily
https://kubernetes.github.io/ingress-nginx/e2e-tests/
- 2024-03-01
+ 2024-03-06
daily
https://kubernetes.github.io/ingress-nginx/faq/
- 2024-03-01
+ 2024-03-06
daily
https://kubernetes.github.io/ingress-nginx/how-it-works/
- 2024-03-01
+ 2024-03-06
daily
https://kubernetes.github.io/ingress-nginx/kubectl-plugin/
- 2024-03-01
+ 2024-03-06
daily
https://kubernetes.github.io/ingress-nginx/lua_tests/
- 2024-03-01
+ 2024-03-06
daily
https://kubernetes.github.io/ingress-nginx/troubleshooting/
- 2024-03-01
+ 2024-03-06
daily
https://kubernetes.github.io/ingress-nginx/deploy/
- 2024-03-01
+ 2024-03-06
daily
https://kubernetes.github.io/ingress-nginx/deploy/baremetal/
- 2024-03-01
+ 2024-03-06
daily
https://kubernetes.github.io/ingress-nginx/deploy/hardening-guide/
- 2024-03-01
+ 2024-03-06
daily
https://kubernetes.github.io/ingress-nginx/deploy/rbac/
- 2024-03-01
+ 2024-03-06
daily
https://kubernetes.github.io/ingress-nginx/deploy/upgrade/
- 2024-03-01
+ 2024-03-06
daily
https://kubernetes.github.io/ingress-nginx/developer-guide/code-overview/
- 2024-03-01
+ 2024-03-06
daily
https://kubernetes.github.io/ingress-nginx/developer-guide/getting-started/
- 2024-03-01
+ 2024-03-06
daily
https://kubernetes.github.io/ingress-nginx/enhancements/
- 2024-03-01
+ 2024-03-06
daily
https://kubernetes.github.io/ingress-nginx/enhancements/20190724-only-dynamic-ssl/
- 2024-03-01
+ 2024-03-06
daily
https://kubernetes.github.io/ingress-nginx/enhancements/20190815-zone-aware-routing/
- 2024-03-01
+ 2024-03-06
daily
https://kubernetes.github.io/ingress-nginx/enhancements/20231001-split-containers/
- 2024-03-01
+ 2024-03-06
daily
https://kubernetes.github.io/ingress-nginx/enhancements/YYYYMMDD-kep-template/
- 2024-03-01
+ 2024-03-06
daily
https://kubernetes.github.io/ingress-nginx/examples/
- 2024-03-01
+ 2024-03-06
daily
https://kubernetes.github.io/ingress-nginx/examples/PREREQUISITES/
- 2024-03-01
+ 2024-03-06
daily
https://kubernetes.github.io/ingress-nginx/examples/affinity/cookie/
- 2024-03-01
+ 2024-03-06
daily
https://kubernetes.github.io/ingress-nginx/examples/auth/basic/
- 2024-03-01
+ 2024-03-06
daily
https://kubernetes.github.io/ingress-nginx/examples/auth/client-certs/
- 2024-03-01
+ 2024-03-06
daily
https://kubernetes.github.io/ingress-nginx/examples/auth/external-auth/
- 2024-03-01
+ 2024-03-06
daily
https://kubernetes.github.io/ingress-nginx/examples/auth/oauth-external-auth/
- 2024-03-01
+ 2024-03-06
daily
https://kubernetes.github.io/ingress-nginx/examples/canary/
- 2024-03-01
+ 2024-03-06
daily
https://kubernetes.github.io/ingress-nginx/examples/customization/configuration-snippets/
- 2024-03-01
+ 2024-03-06
daily
https://kubernetes.github.io/ingress-nginx/examples/customization/custom-configuration/
- 2024-03-01
+ 2024-03-06
daily
https://kubernetes.github.io/ingress-nginx/examples/customization/custom-errors/
- 2024-03-01
+ 2024-03-06
daily
https://kubernetes.github.io/ingress-nginx/examples/customization/custom-headers/
- 2024-03-01
+ 2024-03-06
daily
https://kubernetes.github.io/ingress-nginx/examples/customization/external-auth-headers/
- 2024-03-01
+ 2024-03-06
daily
https://kubernetes.github.io/ingress-nginx/examples/customization/jwt/
- 2024-03-01
+ 2024-03-06
daily
https://kubernetes.github.io/ingress-nginx/examples/customization/ssl-dh-param/
- 2024-03-01
+ 2024-03-06
daily
https://kubernetes.github.io/ingress-nginx/examples/customization/sysctl/
- 2024-03-01
+ 2024-03-06
daily
https://kubernetes.github.io/ingress-nginx/examples/docker-registry/
- 2024-03-01
+ 2024-03-06
daily
https://kubernetes.github.io/ingress-nginx/examples/grpc/
- 2024-03-01
+ 2024-03-06
daily
https://kubernetes.github.io/ingress-nginx/examples/multi-tls/
- 2024-03-01
+ 2024-03-06
daily
https://kubernetes.github.io/ingress-nginx/examples/openpolicyagent/
- 2024-03-01
+ 2024-03-06
daily
https://kubernetes.github.io/ingress-nginx/examples/psp/
- 2024-03-01
+ 2024-03-06
daily
https://kubernetes.github.io/ingress-nginx/examples/rewrite/
- 2024-03-01
+ 2024-03-06
daily
https://kubernetes.github.io/ingress-nginx/examples/static-ip/
- 2024-03-01
+ 2024-03-06
daily
https://kubernetes.github.io/ingress-nginx/examples/tls-termination/
- 2024-03-01
+ 2024-03-06
daily
https://kubernetes.github.io/ingress-nginx/user-guide/basic-usage/
- 2024-03-01
+ 2024-03-06
daily
https://kubernetes.github.io/ingress-nginx/user-guide/cli-arguments/
- 2024-03-01
+ 2024-03-06
daily
https://kubernetes.github.io/ingress-nginx/user-guide/custom-errors/
- 2024-03-01
+ 2024-03-06
daily
https://kubernetes.github.io/ingress-nginx/user-guide/default-backend/
- 2024-03-01
+ 2024-03-06
daily
https://kubernetes.github.io/ingress-nginx/user-guide/exposing-tcp-udp-services/
- 2024-03-01
+ 2024-03-06
daily
https://kubernetes.github.io/ingress-nginx/user-guide/external-articles/
- 2024-03-01
+ 2024-03-06
daily
https://kubernetes.github.io/ingress-nginx/user-guide/fcgi-services/
- 2024-03-01
+ 2024-03-06
daily
https://kubernetes.github.io/ingress-nginx/user-guide/ingress-path-matching/
- 2024-03-01
+ 2024-03-06
daily
https://kubernetes.github.io/ingress-nginx/user-guide/k8s-122-migration/
- 2024-03-01
+ 2024-03-06
daily
https://kubernetes.github.io/ingress-nginx/user-guide/miscellaneous/
- 2024-03-01
+ 2024-03-06
daily
https://kubernetes.github.io/ingress-nginx/user-guide/monitoring/
- 2024-03-01
+ 2024-03-06
daily
https://kubernetes.github.io/ingress-nginx/user-guide/multiple-ingress/
- 2024-03-01
+ 2024-03-06
daily
https://kubernetes.github.io/ingress-nginx/user-guide/retaining-client-ipaddress/
- 2024-03-01
+ 2024-03-06
daily
https://kubernetes.github.io/ingress-nginx/user-guide/tls/
- 2024-03-01
+ 2024-03-06
daily
https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/
- 2024-03-01
+ 2024-03-06
daily
https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/annotations/
- 2024-03-01
+ 2024-03-06
daily
https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/configmap/
- 2024-03-01
+ 2024-03-06
daily
https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/custom-template/
- 2024-03-01
+ 2024-03-06
daily
https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/log-format/
- 2024-03-01
+ 2024-03-06
daily
https://kubernetes.github.io/ingress-nginx/user-guide/third-party-addons/modsecurity/
- 2024-03-01
+ 2024-03-06
daily
https://kubernetes.github.io/ingress-nginx/user-guide/third-party-addons/opentelemetry/
- 2024-03-01
+ 2024-03-06
daily
https://kubernetes.github.io/ingress-nginx/user-guide/third-party-addons/opentracing/
- 2024-03-01
+ 2024-03-06
daily
\ No newline at end of file
diff --git a/sitemap.xml.gz b/sitemap.xml.gz
index 80e83c33a..6795e980c 100644
Binary files a/sitemap.xml.gz and b/sitemap.xml.gz differ