Nginx记录post body内容

nginx在记录http的body内容时,会将中文转义为16进制
在nginx 1.11.8 以上版本中log_format 增加了escape=json 参数,可以不转义变量内容:

log_format access escape=json '$request_time $remote_addr  "$request" "$request_body" $status "$http_referer" "$http_user_agent" '

参考:https://nginx.org/en/docs/http/ngx_http_log_module.html

猜你喜欢

转载自www.cnblogs.com/wshenjin/p/12074722.html