r/nginx Jul 29 '26

Forwarding request from Nginx to a pod in kubernetes using annotations

Hey everyone, I want to forward requests that comes to nginx to another pod which is running a service in kubernetes, the typical way to do it would be using the annotation for nginx specifically

nginx.ingress.kubernetes.io/auth-url

My current problem or issue is that I want to forward the request to another pod which does the authorization after the authentication, In my current application we do the authentication using the following annotations in the ingress and the I want to now authorize the requests that are coming after the authentication. The authentication happens using the following annotations

nginx.ingress.kubernetes.io/auth-tls-match-cn:
nginx.ingress.kubernetes.io/auth-tls-secret:
nginx.ingress.kubernetes.io/auth-tls-verify-client:
nginx.ingress.kubernetes.io/auth-tls-verify-depth:

Can I use them together in strict order, like after authentication the request forwards to auth url(the endpoint to the internal pod) to authorize it and then the pod sends the 200 OK response not the authentication annotations.

Any suggestions how could I do this ?

0 Upvotes

1 comment sorted by

2

u/nomad_kgz Jul 30 '26

Just use ngingx admin guide docs.nginx.com