I compiled the nginx on Ubuntu myself.
I start my nginx with -c nginx.conf parameter.
In my nginx.conf file, I try to turn off error log with but failed.
error_log /dev/null crit;
Still got the error message:
nginx: [alert] could not open error log file: open() “/usr/nginx/logs/error.log” failed (2: No such file or directory)
How could I turn off this log or change its location?
The syntax for disabling the error log is ok, but the docs state that a default logfile is used before the config is read. (which seems reasonable because how would it otherwise tell you you have an error in your config)
Try creating this file by hand with the correct permissions for the user that runs nginx. Or try starting the server as root.