Hi, I want to log my entire request_body, but access.log contains some
strange backslash, how can I remove these backslash before doube quote?

Here is my nginx.conf,
```
log_format  main escape=json '$request_body';

 access_log  logs/access.log  main;
``` 

This is my request code:
```
fetch('http://localhost:8080/njs',{
method:'POST',
body:JSON.stringify({
text:'message with backslash'
})
}).then(res=>res.json()).then((res)=>{
console.info(res)
})
```

And access.log 
```
{\"text\":\"message with backslash\"}
```

But I think it should be 
```
{"text":"message with backslash"}
```

Posted at Nginx Forum: 
https://forum.nginx.org/read.php?2,281634,281634#msg-281634

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx

Reply via email to