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.
err
You can't solve the problem by specifying a -p prefix; because that would only apply to the directives in the configuration file; and as RickyA already noted the problem is that there is a compiled-in error log that nginx wants to open even before it opens the configuration. Changing permissions of the compiled-in error log is not ideal, for obvious reasons.
A workaround is to specify the error log as a configuration on the command line:
$ nginx -p . -g 'error_log error.log;'
or
$ nginx -p . -g 'error_log stderr;'
You'll still get an [alert] but at least it allowed me to start nginx as non-root on Ubuntu.