I am following nginx - read custom header from upstream server . My requirement is to read a http header and send it as a cookie to upstream server So I have following code in location block
if ($http_remote_user){
add_header Set-Cookie UCM_INFO=$http_remote_user;
}
I can see in logs(error.log) that I am getting the value of remote_user but the above mentioned block is not getting executed.What could be the issue?