I have a problem with https redirect from call initiated in the backend. I have a Nginx Ingress Controller with the following setup:
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: ingress-sample
annotations:
kubernetes.io/ingress.class: "nginx"
nginx.ingress.kubernetes.io/affinity: cookie
nginx.ingress.kubernetes.io/ssl-redirect: "true"
nginx.ingress.kubernetes.io/force-ssl-redirect: "true"
spec:
rules:
- http:
paths:
- path: /
backend:
serviceName: sample
servicePort: 8080
It works fine when client access the page through the browser - it uses https to contact with a load balancer and the traffic from the load balancer to pods in the cluster uses HTTP (so SSL is terminated at LB level and a client is forced to use HTTPS). However, when I try to call from my Java application the URL which uses HTTP (like a client is doing) I expect to be redirected automatically to the HTTPS. I receive the correct response (308 permanent redirect) but my call is not automatically moved to https. Is some annotation missing?