IT博客汇
  • 首页
  • 精华
  • 技术
  • 设计
  • 资讯
  • 扯淡
  • 权利声明
  • 登录 注册

    nginx记录POST请求

    admin发表于 2015-05-22 10:07:39
    love 0


    常见的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即可。




沪ICP备19023445号-2号
友情链接