I've got Kubernetes running on Google Cloud, and I have one service connected to a pod with a Nodejs server, and another service connected to a pod with NGINX. In the NGINX pod, I have a location block that I would like to globally deny except if it comes from the Nodejs pod.
What would be the right way to do this in my NGINX conf file ?
What I have at the moment, below, is always being denied by the location block... I'm using the environmental variable for the Nodejs service that is automatically added to the NGINX pod when it is created.
location /target {
deny all;
allow 1.2.3.4; #NODEJS_SERVICE_HOST;
return 200;
}