Is this a request for help? (If yes, you should use our troubleshooting guide and community support channels, see https://kubernetes.io/docs/tasks/debug-application-cluster/troubleshooting/.): Yes
What keywords did you search in NGINX Ingress controller issues before filing this one? (If you have found any duplicates, you should instead reply there.):
Is this a BUG REPORT or FEATURE REQUEST? (choose one):
Feature Request
NGINX Ingress controller version:
nginx version: nginx/1.15.10
Kubernetes version (use kubectl version):
Client: v1.14.0
Server: v1.14.1
Environment:
uname -a): Linux nginx-ingress-controller-7658988787-76h8f 4.19.0-0.bpo.5-amd64 #1 SMP Debian 4.19.37-3~bpo9+1 (2019-05-18) x86_64 GNU/LinuxWhat happened:
I try to make the path of http://localhost/api/application/(.) to be http://location/, but i don't know how to produce it. So, i stuck on annotation rewrite-target and app-root.
What you expected to happen:
Hope my configuration running well for reversing proxy.
How to reproduce it (as minimally and precisely as possible):
File Ingress.yaml
kind: Ingress
apiVersion: extensions/v1beta1
metadata:
name: nginx-http
namespace: default
annotations:
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/ssl-redirect: 'true'
nginx.ingress.kubernetes.io/rewrite-target: /
spec:
tls:
Anything else we need to know:
I need your help. 馃
Closing. Please check https://kubernetes.github.io/ingress-nginx/examples/rewrite/#rewrite-target
Pft... would you give me a troubleshoot, not only source, expertist?
This doesn't work when trying to proxy_pass to other hosts, e.g. when using an externalName service
@k do you have any idea how to make this work for externalName services? I've tried using nginx.ingress.kubernetes.io/upstream-vhost annotation but it redirects me to the new vhost.
@k has an important point, an extremely common use case (including mine) is proxy-passing something like a www.mydomain.com/media to a GCS storage bucket a la https://storage.googleapis.com/${MY_BUCKET}/media/.
@aledbf , is this documented anywhere?
@yaron-idan have you checked this out https://github.com/kubernetes/ingress-nginx/issues/1809 - again, not actual documentation, but looks like a few users have gotten it to work
Thanks @Datamance , I've opted for a different tool by now (AWS API Gateway) but I'll keep this link in mind next time I stumble upon this challenge.
Most helpful comment
Pft... would you give me a troubleshoot, not only source, expertist?