The error message is saying two things:
1st - that the user running NginX does not have access permissions to error log file : /usr/local/var/log/nginx/error.log
2nd - directory of access log file does not exist :
/Users/username/code/product/log
I would solve the case as follows:
1st - checking which user is running NginX; just check the configuration file, through the command:
sudo cat /etc/nginx/nginx.conf | grep user
2nd - changing the NginX log file settings for files that can be accessed by the respective user (in directories that exist, of course) ... run the following commands to check which files are the settings: / p>
cd /etc/nginx
sudo grep -R log *
3rd - edit the files ( sudo pico nginx.conf
or similar) and restart ( sudo service nginx restart
)
Note: The commands above are for a modern Linux Ubuntu; if your system is different, apply the appropriate adaptations