I have a kubernetes cluster with nginx-ingress and I try to redirect http://test.domain.com to http://www.test.domaine.com with nginx.ingress.kubernetes.io/from-to-www-redirect annotation.
But it doesn't seem to work.
My ingress ressource :
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: app-ingress
annotations:
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/from-to-www-redirect: "true"
spec:
rules:
- host: www.test.domain.com
http:
paths:
- path: /
backend:
serviceName: app
servicePort: 8080
- host: test.domain.com
http:
paths:
- path: /
backend:
serviceName: app
servicePort: 8080
I have tried many configuration but I can't make it work. The nginx.ingress.kubernetes.io/from-to-www-redirect annotation have no effect!