我正在尝试记录 POST 正文,并添加$request_body
到log_format
inhttp
子句,但access_log
在我使用以下命令发送 POST 请求后,该命令仅将“-”打印为正文:
curl -d name=xxxx myip/my_location
我的 log_format(在http
子句中):
log_format client '$remote_addr - $remote_user $request_time $upstream_response_time '
'[$time_local] "$request" $status $body_bytes_sent $request_body "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
我的位置定义(在服务器子句中):
location = /c.gif {
empty_gif;
access_log logs/uaa_access.log client;
}
如何从 curl 打印实际的 POST 数据?