title: How to mask sensitive information of POST body in nginx log?
body: <p>For the convenience of analyzing we save the <code>$request_body</code> field in access log. However, there are some sensitive information inside the post body, such as password or credit card number, exposed in the logs. How can we mask these information?  </p>
  
  <pre><code>password=1234asdf  -&gt;  password=****
  </code></pre>
  
  <p>If I write a nginx module to mask the data, should I write a new log module or should I manipulate the request body before the original log module called?<br>
  Or should I use nginx-lua to achieve this goal?<br>
  Or is there any other methods?</p>