0

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?

Chirayu Sharma
  • 75
  • 1
  • 11

1 Answers1

0

Posting the answer so that it helps others.I was able to figure out the solution.Since I had unserscores in headers so nginx was rejecting the headers. So we need to put below in conf file

underscores_in_headers on

Restarted the server and viola it worked.

Chirayu Sharma
  • 75
  • 1
  • 11