Running Ubuntu + PHP + NGINX. Why does the file /usr/local/nginx/on take up so much hard drive space on my web server?

What can i do to reduce it?

  • How much space does it take on your web server, and how much were you expecting?
    – Gareth
    Jan 10 '11 at 9:02

The file name on does not seem to be installed along with Nginx.

Let me have a guess you have a line in you configuration file:

access_log on;


error_log on;

which means Nginx writes access log into file on in its standard directory, which is probably /usr/local/nginx in your case.


Yes, you should change your access_log statements to the path of the log file, and setup log rotation (you must send SIGUSR1 to nginx afterwards so it reopens the log file).

The keyword 'off' is accepted for access_log to prevent logging all together However, the error_log cannot be turned off, instead you must do: error_log /dev/null crit;

logging only critical errors to /dev/null

else you will end up with a large file called 'off'

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.