server {
server_name foo.com;
listen 80;
root '/var/www';
location /divergent {
try_files 'bar' =400;
}
}
In this example, I would like to get a message such as:
2015/03/27 17:53:49 [error] 25248#0: *1 open() '/var/www/bar' failed (2: No such file or directory), client: 37.187.147.109, server: foo.com, request: "GET /bar HTTP/1.1", host: "foo.com"
I would like to get the above message; I do get it sometimes, sometimes I do not. I do not understand what makes the message to propagate.
HTTP block is configured to log all messages:
http {
error_log /var/log/nginx/error.log debug;
# ...
}
This was achieved by rebuilding Nginx with debug information, using the --with-debug
flag. For build instruction, see debugging log documentation.
This allows printing additional information using error_log /path/to/log debug;
instruction. See error_log for details.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With