4

I’m trying to redirect the incoming connections with an ingress of a cluster created in IBM Cloud.

I’m able to successfully set up the ingress and contact the pod.

However, when the connection reaches the endpoint http://app1.myaddress.cloud/test1 is not rewrited to the right pod url ( The path still contains the /test1 and I want to remove that part).

Do you have any idea how to solve the issue?

apiVersion: extensions/v1beta1
kind: Ingress
metadata:
  name: hello-world-ingress
  annotations:
    nginx.ingress.kubernetes.io/rewrite-target: /
spec:
  tls:
  - hosts:
    - app1.myaddress.cloud
    secretName: myclustername
  rules:
  - host: app1.myaddress.cloud
    http:
      paths:
      - path: /test
        backend:
          serviceName: hello-world-service-1
          servicePort: 30001
Jeff Sloyer
  • 4,899
  • 1
  • 24
  • 48
Leonardo Carraro
  • 1,532
  • 1
  • 11
  • 24
  • What HTTP head your pod is receiving? Can you print it to the response, as in example https://kubernetes.github.io/ingress-nginx/examples/rewrite/ – Kirill Dec 02 '18 at 10:13
  • https://stackoverflow.com/questions/47837087/nginx-ingress-rewrite-target might help – Clorichel Dec 02 '18 at 15:50

1 Answers1

0

I found the official IBM Cloud tutorial here.

https://cloud.ibm.com/docs/containers?topic=containers-ingress_annotation

Leonardo Carraro
  • 1,532
  • 1
  • 11
  • 24