title: How to edit nginx ingress config in kubernetes?
body: <p>I need to implement logging for kubernetes ingress installation so all request will be logging with the following details:</p>
  
  <ul>
  <li>Request headers</li>
  <li>Request body</li>
  <li>Response headers</li>
  <li>Response body</li>
  </ul>
  
  <p>I understand that I can edit <code>log_format</code> of nginx using <a href="https://github.com/kubernetes/ingress-nginx/blob/master/docs/user-guide/configmap.md" rel="nofollow noreferrer">ConfigMap</a>, however, for logging response body, I need to use lua (something like <a href="https://gist.github.com/morhekil/1ff0e902ed4de2adcb7a" rel="nofollow noreferrer">this</a>). </p>
  
  <p>In this case, I should have possibility to add this lua code in every server section of nginx config. What is the most easy way to do it?</p>
  
  <p>Thank you!</p>