docs: Clarify from-to-www redirect direction.

This was not clear to me when reading the docs whether the ingress will
redirect from non-www to with-www or the reverse. It's also not very
clear from just grepping around the codebase. I found the answer by
reading from this reddit link:

https://www.reddit.com/r/kubernetes/comments/pbl033/k8s_ingress_redirecting_www_to_nonwww_domains/

So, to save time for other people doing the same, which I assumes is a
lot of people since it's a common scenario, this little revision in the
docs is warranted.
This commit is contained in:
Chakrit Wichian 2024-07-26 14:24:31 +07:00 committed by k8s-infra-cherrypick-robot
parent 2c32bd026f
commit 1a2d02c37c

View file

@ -638,7 +638,9 @@ To preserve the trailing slash in the URI with `ssl-redirect`, set `nginx.ingres
### Redirect from/to www
In some scenarios is required to redirect from `www.domain.com` to `domain.com` or vice versa.
In some scenarios is required to redirect from `www.domain.com` to `domain.com` or vice versa,
which way the redirect is performed depends on the configured `host` value in the Ingress object.
To enable this feature use the annotation `nginx.ingress.kubernetes.io/from-to-www-redirect: "true"`
!!! attention