For testing purposes (in particular I'm developing a performance analyzer for a website that currently runs in production) I need to have some endpoints (es: /performance) that should be processed by nginx (they acquire data like time points etc. and save them to file).
But, obviously, a website may have a folder/routed path that matches my endpoint name. So, I'm willing to be able to make the endpoint /performance works as a standard reverse proxy, unless a custom HTTP header [or even a particular GET value] is set.
How can I turn on/off proxy_pass at will in nginx, for a specified location? I know I can't use if, for, etc. in configuration files in Perl. Is there another way?