- Setup: Azure AKS with application gateway ingress, annotated with
- Problem: Root path doesn’t get redirected to HTTPS.
apiVersion: extensions/v1beta1 kind: Ingress metadata: name: my-ingress annotations: kubernetes.io/ingress.class: azure/application-gateway appgw.ingress.kubernetes.io/backend-path-prefix: "/$ 1" appgw.ingress.kubernetes.io/ssl-redirect: "true" spec: tls: - hosts: - my.company.com secretName: my rules: - host: my.company.com http: paths: - path: /(.*) backend: serviceName: my-gui-svc servicePort: 80 - path: /svc1/(.*) backend: serviceName: my-svc1-svc servicePort: 80 - path: /svc2/(.*) backend: serviceName: my-svc2-svc servicePort: 80
Here’s the resonse from
curl on one of the non-root routes:
C:\>curl http://my.company.com/svc1/ <html> <head><title>301 Moved Permanently</title></head> <body bgcolor="white"> <center><h1>301 Moved Permanently</h1></center> <hr><center>Microsoft-Azure-Application-Gateway/v2</center> </body> </html>
And here it is for the root rule:
C:\>curl http://my.company.com/foo <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> ...
I also tried playing with the order in which the rules are listed, putting the root path at the end for example, but it didn’t make a difference.
Also, when I examine the rules in the Azure portal, this is what I see:
(name/site strings in the picture have been modified for security)
What am I doing wrong?