nginx记录POST请求

常见的nginx配置中只能记录GET请求,没有记录POST请求,可通过以下方法实现:

log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '

                      '$status $body_bytes_sent $request_body "$http_referer" '

                      '"$http_user_agent" "$http_x_forwarded_for"';

添加 $request_body 在log_format段中重启nginx即可。

上一篇 CentOS 6.5 安装nagios监控
下一篇 nginx日志分割

探索站点内容

搜索文章、标签、分类

站点性能

运行正常
实时心跳0 ms
页面加载
0
SQL 查询
0
服务端响应
0 ms
峰值内存
0 MB