Forum Discussion
How to rewrite a path to a backend service dropping the prefix and passing the remaining path?
Rob_Michel As BrianEhlert mentioned, you need to change your annotation and Ingress resource slightly to match the commercial version of NGINX Ingress controller.
You can try something like this:
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: cafe-ingress
annotations:
nginx.org/rewrites: "serviceName=httpbin-service rewrite=/"
spec:
rules:
- host: cat.abitofhelp.io
http:
paths:
- path: /httpbin/
pathType: Prefix
backend:
service:
name: httpbin-service
port:
number: 8999
Make sure you adjust accordingly to match your environment.
Hi Guys,
Thank you very much for your detailed responses! I am traveling today but will make the changes when I get to the office and will report back. If things go well, I will put together a simple demo that implements current best practices for gateway security and routes gRPC and HTTP->HTTPS traffic. I will use it for a presentation to Management and will post it here and in a few other locations to help others kick-start a demo.
We are currently using Emissary Ingress and are tired of wrangling poor documentation, bugs, and lack of quality community/support. My hope is to get the green light to migrate to nginx.com.
I will report back and want to thank you for your help!
Mike
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com