Hello My project has a total of 2 services. It consists of a service composed of Spring MVC and a service composed of nodejs, and both services are using http. I use Ingress as one domain. and I applied tls to this ingress and modified it to use https.
However, I am getting a 502 error. I think this is because Spring MVC and nodejs server use http. Can't I solve it without applying https to two servers?
My Ingress is
apiVersion: networking.k8s.io/v1beta1
kind: Ingress
metadata:
name: service-loadbalancing
annotations:
kubernetes.io/ingress.class: "nginx"
spec:
rules:
- host: domain-address
http:
paths:
- path: /
backend:
serviceName: spring-service
servicePort: 9000
- path: /index
backend:
serviceName: node-service
servicePort: 9001
tls:
- hosts:
- domain-address
secretName: nginx-tls
THANK!!!
My ingress pod logs
172.17.0.1 - - [01/Apr/2020:02:10:28 +0000] "GET / HTTP/2.0" 200 4236 "https://mydomain/login?timeout=1" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36" 18 0.007 [default-spring-service-9000] [] 172.17.0.8:1111
2020/04/01 02:10:28 [error] 6773#6773: *7390742 connect() failed (111: Connection refused) while connecting to upstream, client: 172.17.0.1, server: _, request: "GET /resources/aiaas/kr/css/reset.css HTTP/2.0", upstream: "http://172.17.0.9:1111/resources/aiaas/kr/css/reset.css", host: "mydomain:8891", referrer: "https://mydomain:8891/"