简体   繁体   English

Kubernetes入口编辑:HTTP 400错误请求-普通的HTTP请求已发送到HTTPS

[英]Kubernetes ingress edit: HTTP 400 Bad request - The plain HTTP request was sent to HTTPS

Could there be any reason why a webapp which perfectly loads up fine gives a *HTTP 400 Bad request - The plain HTTP request was sent to HTTPS* port after the webapp's ingress has been edited manually or edited through an automated job which updates the ingress modifying the Whitelisted IPs 可能有任何原因导致完美加载的*HTTP 400 Bad request - The plain HTTP request was sent to HTTPS*应用程序发出*HTTP 400 Bad request - The plain HTTP request was sent to HTTPS*手动编辑了*HTTP 400 Bad request - The plain HTTP request was sent to HTTPS*应用程序的入口或通过更新更新入口修改的自动化作业编辑了*HTTP 400 Bad request - The plain HTTP request was sent to HTTPS*应用程序的入口后, *HTTP 400 Bad request - The plain HTTP request was sent to HTTPS*端口白名单IP

Apparently, this issue gets fixed when we redeploy the webapp after purging the webapp deployment ... 显然,在清除webapp部署后重新部署webapp时,此问题已得到解决。

Any pointers to this would be great as this happens on our PROD env and not reproducible on any lower envs. 任何指向此操作的指针都将非常有用,因为这会在我们的PROD环境中发生,而在任何较低的环境中均不可复制。 Points to note:- - Nginx Ingress controller setup is the same across lower envs and Prod env. 注意事项:--Nginx Ingress控制器在较低环境和Prod环境中的设置相同。

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  annotations:
    ingress.kubernetes.io/force-ssl-redirect: "true"
    ingress.kubernetes.io/ingress.allow-http: "false"
    ingress.kubernetes.io/proxy-body-size: 20M
    ingress.kubernetes.io/secure-backends: "true"
    ingress.kubernetes.io/whitelist-source-range: xxx.yy.zz.pp/32, yyy.ss.dd.kkl/32
    ingress.kubernetes.io/whitelist-source-range-status: unlocked
creationTimestamp: 2018-11-29T15:34:05Z
generation: 5
 labels:
   app: xyz-abc-pqr
  name: xxxx-webapp-yyyy-zzzz
  namespace: nspsace-name
  resourceVersion: "158237270"
  selfLink: /apis/extensions/v1beta1/namespaces/nspsace-name/ingresses/xxxx-webapp-yyyy-zzzz
  uid: 348f892e-f3ec-11e8-aa6f-0a0340041348
  spec:
   rules:
    - host: ssssssss.wwwwweewwerwerw.co.uk
      http:
      paths:
       - backend:
          serviceName: xxxx-webapp-yyyy-zzzz
          servicePort: 443
        path: /
    - host: xxxx-webapp-yyyy-zzzz.bbbbv.lasdfkla.ajksdfh.ioohhsaf.pp
     http:
       paths:
        - backend:
          serviceName: xxxx-webapp-yyyy-zzzz
          servicePort: 443
       path: /
     tls:
       - hosts:
          - ssssssss.wwwwweewwerwerw.co.uk
          - xxxx-webapp-yyyy-zzzz.bbbbv.lasdfkla.ajksdfh.ioohhsaf.pp
         secretName: xxxx-webapp-yyyy-zzzz-server-tls
     status:
       loadBalancer:
        ingress:
         - {}

There may be something wrong with the ingress controller and how it updates its configuration. 入口控制器及其更新配置的方式可能有问题。 I'm assuming you are using a nginx ingress controller so you can inspect the configs before an after: 我假设您正在使用nginx入口控制器,因此可以在之后检查配置:

$ kubectl cp <nginx-ingress-controller-pod>:nginx.conf nginx.conf.before
$ kubectl edit ingress <your-ingress>
$ kubectl cp <nginx-ingress-controller-pod>:nginx.conf nginx.conf.after
$ diff nginx.conf.before nginx.conf.after

You can see the this may happen with nginx because of something like this: Dealing with nginx 400 "The plain HTTP request was sent to HTTPS port" error . 您可以看到nginx可能由于以下原因而发生这种情况: 处理nginx 400“普通HTTP请求已发送到HTTPS端口”错误

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 kubernetes 入口控制器`400 错误请求 - 普通 HTTP 请求发送到 HTTPS 端口` - kubernetes ingress-controller `400 Bad request - plain HTTP request sent to HTTPS port` 404 Not Found Ingress-nginx 和 400 Bad Request 普通的 HTTP 请求被发送到 HTTPS 端口 nginx - 404 Not Found Ingress-nginx and 400 Bad Request The plain HTTP request was sent to HTTPS port nginx 400 Bad Request You're speak plain HTTP to an SSL-enabled server port kubernetes pod - 400 Bad Request You're speaking plain HTTP to an SSL-enabled server port kubernetes pod ingress-nginx:客户端向 https 服务器发送 http 请求 - ingress-nginx: client sent http request to https server 客户端向 HTTPS 服务器发送 HTTP 请求 - Kubernetes 集群 - Client sent an HTTP request to an HTTPS server - Kubernetes cluster 为什么这个 HTTP 对 Ingress (GKE) 的 GET 请求总是返回 400(错误请求)错误? - Why this HTTP GET request to the Ingress (GKE) is always returning 400 (bad request) error? Istio Ingress 路由失败并出现 400 Bad request for Kubernetes 中的 shiny 服务器 - Istio Ingress routing fails with 400 Bad request for shiny server in Kubernetes Kubernetes 入口将 http 重定向到 https - Kubernetes ingress redirects http to https How to setup nginx ingress controller, such that the kubernetes pod remains http but the nginx serves request on https - How to setup nginx ingress controller , such that the kubernetes pod remains http but the nginx serves request on https 客户端向 HTTPS 服务器发送 HTTP 请求 - Client sent an HTTP request to an HTTPS server
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM