How to log all headers in nginx?

How do I go about logging all of the headers client browser has sent in
Nginx? I also want to log response header. Note that I am using nginx as
reverse proxy.

After going through documentation, I understand that I can log a
header, but I want to log all of the headers.