nginx 日志打印post请求参数

Posted 敲出一个世界

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了nginx 日志打印post请求参数相关的知识,希望对你有一定的参考价值。

在日志格式后面加上 $request_body 配置信息
 log_format  main  ‘$remote_addr - $remote_user [$time_local] "$request" ‘
                      ‘$status $body_bytes_sent "$http_referer" ‘
                      ‘"$http_user_agent" "$http_x_forwarded_for" $request_body‘;

 access_log  logs/access.log  main;

  

以上是关于nginx 日志打印post请求参数的主要内容,如果未能解决你的问题,请参考以下文章