<p>I've tried everything on stack overflow and beyond and can't find a solution that works to redirect http to https. My current config is below.</p>
<p>My ingress is:</p>
<pre><code>apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: ingress
  annotations:
    kubernetes.io/ingress.class: &quot;nginx&quot;
    kubernetes.io/ingress.global-static-ip-name: my-address
    networking.gke.io/managed-certificates: my-certificate
    nginx.ingress.kubernetes.io/force-ssl-redirect: &quot;true&quot;
    nginx.ingress.kubernetes.io/ssl-redirect: &quot;true&quot;
    nginx.ingress.kubernetes.io/from-to-www-redirect: &quot;true&quot;
spec:
  rules:
  - host: mydomain.com
    http:
      paths:
      - path: /*
        pathType: ImplementationSpecific
        backend:
          service:
            name: my-service
            port:
              number: 2400
</code></pre>
<p>And my service is:</p>
<pre><code>apiVersion: v1
kind: Service
metadata:
  name: my-service
spec:
  type: NodePort
  selector:
    app: nodeweb
  ports:
  - name: my-service-port
    protocol: TCP
    port: 2400
    targetPort: 2400
</code></pre>

<p>For GKE (<code>1.17.13-gke.2600+</code>), find <a href="https://cloud.google.com/kubernetes-engine/docs/how-to/ingress-features#https_redirect" rel="nofollow noreferrer">this document</a> explaining how to configure FrontendConfig with http-to-https redirect. Then you <a href="https://cloud.google.com/kubernetes-engine/docs/how-to/ingress-features#associating_frontendconfig_with_your_ingress" rel="nofollow noreferrer">associate</a> the FrontendConfig with your Ingress using <code>networking.gke.io/v1beta1.FrontendConfig</code> annotation.</p>
