Kubernetes Ingress path not finding resources
I guess nginx.ingress.kubernetes.io/rewrite-target: /
annotation in your Ingress
configuration doesn't bring any success for multipath rewrite target paths, read more here. However, you can consider to use Nginx Plus Ingress controller, shipped with nginx.org/rewrites:
annotation and can be used for pointing URI paths to multiple services as described in this example.
You can also think about using nginx.ingress.kubernetes.io/configuration-snippet
annotation for the existing Ingress
, which can adjust rewrite rules to Nginx location, something like:
apiVersion: extensions/v1beta1kind: Ingressmetadata: annotations: kubernetes.io/ingress.class: nginx kubernetes.io/tls-acme: "true" nginx.ingress.kubernetes.io/proxy-body-size: 50m nginx.ingress.kubernetes.io/configuration-snippet: | rewrite /first-app/(.*) $1 break; rewrite /secondary-app/(.*) /$1 break; name: my-appspec: rules: - host: my-app.example.com http: paths: - backend: path: /first-app serviceName: my-app servicePort: http - backend: path: /secondary-app serviceName: secondary-app servicePort: http