September 3, 2019

/etc/nginx/off, What Might That Be?

Do you have a curious file named off in your Nginx config directory which consists of lines of Nginx error log format? Things like upstream timed out, no such file errors?

If so, grep your .conf files and see if you have a directive like this;

error_log off;

At this point you’ve probably figured out what is going on, but here’s the explanation anyway. This is actually not a valid Nginx directive. Well, it is, but it doesn’t actually do what you might think it does. Unlike access_log off directive, Nginx doesn’t allow you to completely disable error logging like that. Instead it writes the errors to a file called off inside current directory.

To completely disable error logging you can set the file to /dev/null;

error_log /dev/null;

© Ahmet Kun 2019