Hi, I've been struggling to set a rewrite rule for my ingress (GCP Kubernetes with a Deployment, Service NodePort and Ingress). What I'm trying to get is:
So that my server can server requests whether they start with /api/ or /www/, without a care about the subdomains.
I'm creating this issue because I have a question regarding your comment in https://github.com/kubernetes/ingress-gce#paths
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: nginxtest-ingress
spec:
rules:
- http:
paths:
- path: /hostname
backend:
serviceName: nginxtest
servicePort: 80
Note what just happened, the endpoint exposes /hostname, and the loadbalancer forwarded the entire matching url to the endpoint. This means if you had '/foo' in the Ingress and tried accessing /hostname, your endpoint would've received /foo/hostname and not known how to route it.
I wish that was true... for me, loadbalancerip/foo would be the only queryable url, while everything else returns 404 Not Found errors. The Ingress only forward a request if it matches the path, that's it.
Anyways, if you have a suggestion regarding my problem, I'd really appreciate. Couldn't figure out how to get it working with annotations rewrite-url or app-root
Hi, I've been struggling to set a rewrite rule for my ingress (GCP Kubernetes with a Deployment, Service NodePort and Ingress). What I'm trying to get is:
So that my server can server requests whether they start with /api/ or /www/, without a care about the subdomains.
I'm creating this issue because I have a question regarding your comment in https://github.com/kubernetes/ingress-gce#paths
I wish that was true... for me, loadbalancerip/foo would be the only queryable url, while everything else returns 404 Not Found errors. The Ingress only forward a request if it matches the path, that's it.
Anyways, if you have a suggestion regarding my problem, I'd really appreciate. Couldn't figure out how to get it working with annotations rewrite-url or app-root