website icon indicating copy to clipboard operation
website copied to clipboard

Issue with ingress port config

Open zhyinjun opened this issue 8 years ago • 1 comments

Problem: I have my java application running well in my local, but when i deployed it on the kubernetes with ingress, there is a port forwarding issue..

On my local, following url is working correctly.

http://www.example.com:9080/app/eh https://www.example.com:9443/app/eh https://www.example.com/app/eh

On the kubernetes env..

http://www.example2.com/app/eh (working) https://www.example2.com/app/eh (expected) https://www.example2.com:80/app/eh (real result)

On the https://www.example2.com/app/eh/xxxx page, I use following java code do the redirection, response.sendRedirect(request.getContextPath()); // equals response.sendRedirect('/app/eh') it takes me to the https://www.example2.com:80/app/eh, rather than https://www.example2.com/app/eh.

kubectl get ing thcaas-eh
NAME        HOSTS                                              ADDRESS            PORTS     AGE
thcaas-eh   www.example2.com   158.87.63.26,...   80, 443   2d
kubectl describe ing thcaas-eh
Name:             thcaas-eh
Namespace:        thcaas-dev
Address:          158.87.63.26,158.87.63.27
Default backend:  default-http-backend:80 (100.127.50.199:8080)
TLS:
  tls.thcaas.icp1 terminates www.example2.com
Rules:
  Host                                              Path  Backends
  ----                                              ----  --------
  www.example2.com  
                                                    /app/eh   eh:9080 (<none>)
Annotations:
  ssl-redirect:         true
  tls-minimum-version:  1.2
Events:
  Type    Reason  Age               From                      Message
  ----    ------  ----              ----                      -------
  Normal  UPDATE  45m (x8 over 2d)  nginx-ingress-controller  Ingress thcaas-dev/thcaas-eh
  Normal  UPDATE  44m (x8 over 2d)  nginx-ingress-controller  Ingress thcaas-dev/thcaas-eh

How can i make it's working on the port 443? Takes me to the page, https://www.example2.com/app/eh

zhyinjun avatar Aug 24 '18 13:08 zhyinjun

Hey, this is a support request and not related to an issue with the docs. I would recommend reaching out to a channel on slack or the discussion board for help: https://kubernetes.io/community/

Thanks! /close

jimangel avatar Aug 27 '18 06:08 jimangel