我試圖登錄POST體,並在http
子句添加$request_body
到log_format
,但access_log
命令只是打印「 - 」因爲身體後我用發送POST請求:真的記錄(而不是「 - 」)POST請求體nginx的
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數據?
聽起來像這些傢伙找到了解決辦法: http://stackoverflow.com/questions/4939382/logging-post-data-from-request-body – aet