URL Rewrites broken on Ingress

Hi all,
We have a kubernetes nginx-ingress controller to manage our API connectivity. For it to work properly the endpoints need to see the requesting URI as “/” and not “/endpoint/something”. So we have created rewrite rules which work fine until we enable Cloudflare. Once enabled it appears that the rewrite rules are being ignored and the endpoints are receiving requests for “/endpoint/something” instead of “/”. I’ve looked at page rules but cannot seem to find a way to fix this. Suggestions welcome!

Note that this is behind SSL. Any help appreciated!

Our Ingress rules look like:

apiVersion: extensions/v1beta1
kind: Ingress
  name: my-ingress
     kubernetes.io/ingress.class: "nginx"
     nginx.com/health-checks: "true"
     nginx.ingress.kubernetes.io/rewrite-target: /$1
     nginx.ingress.kubernetes.io/ssl-redirect: false
     nginx.ingress.kubernetes.io/force-ssl-redirect: false
  name: rewrite
  namespace: default
  - host: "mysite.com"
     - path: /api/v1/something/?(.*)
          serviceName: myservice-api
          servicePort: 5006

This topic was automatically closed after 14 days. New replies are no longer allowed.