[英]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.