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
I solved this issue using the -p parameter when starting nginx e.g:
/home/ubuntu/nginx/sbin/nginx -c /home/ubuntu/nginx/conf/nginx.conf -p /home/ubuntu/nginx
This will prepend any log paths specified in the config with the prefix directory.