I'd like to have my Nginx load balancer send a timestamp in a header onto the upstream servers.
I tried something like this:
proxy_set_header X-Start-Time $msec;
Of course, $msec is a log variable and Nginx gives an error:
Restarting nginx: [emerg]: unknown "msec" variable
Best Answer
$msec
is indeed a variable that lives only during log writing.The easiest solution would be to build Nginx with Perl module and define a variable backed by Perl subroutine: