默认情况下,在Kubernetes NGINX入口中启用SSL重定向。怎么能被禁用?目前的实施如下:
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
答案 0 :(得分:7)
将ingress.kubernetes.io/ssl-redirect: "false"
添加到annotations
将禁用SSL重定向:
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
请注意,false
包含在引号中。我发现如果没有这种字符串拼接,它就无法工作。