nginx: [emerg] open() “/usr/share/nginx/off” failed (13: Permission denied) [SOLVED]

Leave a comment
Howtos / System Administration

After a failed restart of the nginx server, you can get this error typing journalctl -xe:

nginx: [emerg] open() “/usr/share/nginx/off” failed (13: Permission denied) [SOLVED]

This is caused by a misconfiguration of nginx.conf or a conf inside the /etc/nginx/conf.d/ directory where there’s something like:

error_log off;

This is the wrong way to disable logs. Nginx is actually trying to write a file called off inside the default folder.

The right way

To disable error_log simply do not declare it in your .conf file.

To stop logging accesses, you can disable access_log writing in your .conf file:

access_log off;

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s