title: NGINX: Obfuscate password in access_log
body: <p>I want to log the <code>$request_body</code> in the access logs.</p>
  
  <p>But some of the requests have some JSON fields that are sensitive like passwords. </p>
  
  <p>Example:</p>
  
  <pre><code>[2019-03-28] 201 - POST /api/user/add HTTP/1.1 - {\x22email\x22:\x22test@test.com\x22,\x22password\x22:\x22myPassword\x22}
  </code></pre>
  
  <p>Is there a way to obfuscate the password value so the output would look something like this: </p>
  
  <pre><code>[2019-03-28] 201 - POST /api/user/add HTTP/1.1 - {\x22email\x22:\x22test@test.com\x22,\x22password\x22:\x22****\x22}
  </code></pre>