An SSL redirect is enabled by default in a Kubernetes NGINX ingress. How can this be disabled? Current implementation below:
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: project_name-ingress
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /
spec:
rules:
- http:
paths:
- path: /
backend:
serviceName: project_name
servicePort: 80
Adding ingress.kubernetes.io/ssl-redirect: "false"
to annotations
will disable the SSL redirect:
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: project_name-ingress
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /
nginx.ingress.kubernetes.io/ssl-redirect: "false"
spec:
rules:
- http:
paths:
- path: /
backend:
serviceName: project_name
servicePort: 80
Note that false
is wrapped in quotation marks. I found it didn't work without this string casting.