You can also add which user will run the nginx. In the nginx.conf file, make the following changes:
user root;
You can add the above line as the first line in your nginx conf. You can write the name of any user who has the permission to write in that directory.