One solution is to add a separate log_format directive including variables for the desired headers, put an access_log directive in the location and map the headers to the variables referenced in the log_format directive.
Alex
Alex