Request Id for logging purposes

Igal @ igal at
Wed Feb 4 19:07:13 UTC 2015


I want to be able to identify requests by a unique id. 

I'm able to do this in the location section:

        proxy_set_header    X-Request-Id       

but I want instead to set it to a variable, e.g. in the http section:

    set $request_id $pid-$msec-$remote_addr-$request_length;    ## does
this work?

    add_header      X-Request-Id    $request_id;    ## I don't see it in
the response headers

can it work?


More information about the nginx mailing list