nginx记录post数据日志

时间:2016-03-22 12:15:47   收藏:0   阅读:140

 1、vi nginx.conf

找到http {}中log_foramt ,定义post 日志格式

    #log_format  main  $remote_addr - $remote_user [$time_local] "$request" 
    #                  $status $body_bytes_sent "$http_referer" 
    #                  "$http_user_agent" "$http_x_forwarded_for";

    log_format post_log $remote_addr - $remote_user [$time_local] -- $request_body;

有日志demo形式,可根据自己需要配置日志格式。

2、在location php 解析{}中加入记录日志

access_log /opt/log/post.log post_log;

保存。重启即可

原文:http://www.cnblogs.com/already/p/5305530.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!