I want to add a custom header for the response received from the server behind nginx.
While add_header works for nginx-processed responses, it does noth
add_header
As oliver writes:
add_header works as well with proxy_pass as without.
proxy_pass
However, as Shane writes, as of Nginx 1.7.5, you must pass always in order to get add_header to work for error responses, like so:
always
add_header X-Upstream $upstream_addr always;