Certificate Authentication on Proxy Pass between 2 App Services
I have two Azure App Service running in NGINX and PHP.
Azure App Service A acts like a reverse-proxy to App Service B, which it will forward the request of /api via proxy_pass. I want to do manual certificate verification via a custom header. So I made a small test.
This is how I set the configuration for nginx.conf
Location ^~ /api {
proxy_set_header X-Custom "test";
proxy_pass_request_headers on;
proxy_pass https://apiwebsite.azurewebsites.net/api;
}
For first trial code above, I purposely set header of X-Custom and "test" as string. But upon inspection in App Service B, I try to find the HTTP_X_Custom, but I cannot find the header at all.
I tried to direct request to App Service B with the custom header, and I can see the custom header. But only on proxy_pass between two App Services, seems that the HTTP header get sanitized in the middle.
May I seek your help to help me understand on the concept here? How to solve this?
Thanks