How to debug lua code inside nginx config?



I want to insert log points (io.write) inside my lua code which itself is in nginx configuration (using HttpLuaModule for nginx).
How to do that?
Access and error logs are not showing them.


When running under nginx, you should use ngx.log. E.g:

ngx.log(ngx.STDERR, 'your message here')

For a working example, see

For documentation, see

Answered By – mikaraento

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave A Reply

Your email address will not be published.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More