I am trying to write the body of request requests to api, and nginx turns all quotes (and some other characters, such as spaces and tabs) into hexadecimal characters.
Here is my magazine format
log_format postdata '{"ts": "$time_iso8601", "status": $status, "req": "$uri", "meth": "$request_method", "body": "$request_body"}';
Here is what is logged
{"ts": "2015-05-20T15:31:11-07:00", "status": 400, "req": "/v2/track", "meth": "POST", "body": {\x22id\x22:\x22user id\x22}}
How can I prevent this so that the log summary line
{"ts": "2015-05-20T15:31:11-07:00", "status": 400, "req": "/v2/track", "meth": "POST", "body": {"id":"user id"}}
source
share