I'm trying to redirect all non-www traffic to www subdomain for url canonicalization. So all traffic on example.com should be rewritten to . I can't seem to figure out how though.
My Ingress:
{
"apiVersion": "extensions/v1beta1",
"kind": "Ingress",
"metadata": {
"name": "example-staging",
"annotations": {
"ingress.kubernetes.io/rewrite-target": "/",
"kubernetes.io/ingress.global-static-ip-name": "example-static-ip"
}
},
"spec": {
"rules": [
{
"host": "www.example.nl",
"http": {
"paths": [
{
"path": "/",
"backend": {
"serviceName": "example-service",
"servicePort": 80
}
}
]
}
}
]
}
}