Is there any way to add in request header while sending it to proxy server? I tried using add_header as well as proxy_set_header but it did not work for me.
Below is the headers.conf file content I tried:
Trial1:
proxy_set_header X-Name "Vishal";
Trial2:
add_header X-Name "Vishal";
My nginx\conf\includes\proxy.conf:
location /api/mysvc/v1 {
proxy_pass "https://mockable.io/mysvc/v1/";
proxy_pass_request_headers on;
proxy_set_header X-Name "Vishal";
}
I want to pass along this request header in every ajax request my app makes.
proxy_set_headeris the correct directive to use. Where isheaders.confincluded? What does the block containing theproxy_passstatement look like?