title: Kubernetes ingress edit: HTTP 400 Bad request - The plain HTTP request was sent to HTTPS
body: <p>Could there be any reason why a webapp which perfectly loads up fine gives a <code>*HTTP 400 Bad request - The plain HTTP request was sent to HTTPS*</code> port after the webapp's ingress has been edited manually or edited through an automated job which updates the ingress modifying the Whitelisted IPs </p>
  
  <p>Apparently, this issue gets fixed when we redeploy the webapp after <em>purging the webapp deployment</em>... </p>
  
  <p>Any pointers to this would be great as this happens on our PROD env and not reproducible on any lower envs.
  Points to note:-
  - Nginx Ingress controller setup is the same across lower envs and Prod env.</p>
  
  <pre><code>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:
           - {}
  </code></pre>