如何在Nginx中记录所有标头? [英] How to log all headers in nginx?
问题描述
如何记录客户端(浏览器)在Nginx中发送的所有标头?我也想记录响应头.请注意,我正在使用nginx作为反向代理.
How do I log all the headers the client (browser) has sent in Nginx? I also want to log the response headers. Note that I am using nginx as reverse proxy.
在阅读了文档之后,我了解到我可以记录特定的标头,但是我想记录所有标头.
After going through documentation, I understand that I can log a specific header, but I want to log all of the headers.
推荐答案
经过大量研究,我可以得出结论认为这是不可能的.
After much research, I can conclude that it is not possible out of the box.
更新-您可以使用Lua随附的openresty.使用Lua可以做很酷的事情,包括记录所有标头,例如Redis或其他服务器
Update- you can use openresty which comes with Lua. Using Lua one can do pretty cool things, including logging all of the headers to say, Redis or some other server
这篇关于如何在Nginx中记录所有标头?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!