gpt4 book ai didi

kubernetes - 即使设置了configmap和注解,nginx入口也始终重定向到https

转载 作者:行者123 更新时间:2023-12-02 12:18:35 25 4
gpt4 key购买 nike

我有一个这样配置的入口:

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: connect-app
namespace: default
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /
nginx.ingress.kubernetes.io/ssl-redirect: "false"
spec:
rules:
- host: it.tufts.edu
http:
paths:
- path: "/"
backend:
serviceName: connect-it
servicePort: 80

Nginx Controller 具有如下配置图:
apiVersion: v1
items:
- apiVersion: v1
data:
ssl-redirect: "false"
kind: ConfigMap
metadata:
annotations:
kubectl.kubernetes.io/last-applied-configuration: |
{"apiVersion":"v1","data":null,"kind":"ConfigMap","metadata":{"annotations":{},"name":"nginx-config","namespace":"nginx-ingress"}}
creationTimestamp: 2018-11-13T20:56:49Z
name: nginx-config
namespace: nginx-ingress
resourceVersion: "3633400"
selfLink: /api/v1/namespaces/nginx-ingress/configmaps/nginx-config
uid: a3ec70bc-e786-11e8-be24-005056a401f6
kind: List
metadata:
resourceVersion: ""
selfLink: ""

根据文档,这应该禁用从http到https的重定向,但似乎没有用,我在做什么错?

谢谢

最佳答案

我相信这是:

  • 您的nginx入口 Controller 未更新可用于检查的配置的问题:
    $ kubectl cp <nginx-ingress-controller-pod>:nginx.conf .
    $ cat nginx.conf
  • 您的apache配置从HTTP(端口80)重定向到HTTPS时出现问题
  • 关于kubernetes - 即使设置了configmap和注解,nginx入口也始终重定向到https,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53535769/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com