Logging POST data from $request_body

前端 未结 7 1538
日久生厌
日久生厌 2020-11-27 10:52

I have my config setup to handle a bunch of GET requests which render pixels that work fine to handle analytics and parse query strings for logging. With an additional third

7条回答
  •  一整个雨季
    2020-11-27 11:51

    Try echo_read_request_body.

    "echo_read_request_body ... Explicitly reads request body so that the $request_body variable will always have non-empty values (unless the body is so big that it has been saved by Nginx to a local temporary file)."

    location /log {
      log_format postdata $request_body;
      access_log /mnt/logs/nginx/my_tracking.access.log postdata;
      echo_read_request_body;
    }
    

提交回复
热议问题