At first, check what user is running your nginx server ps aux | grep nginx
root 18794 0.0 0.2 43372 1496 ? Ss 17:26 0:00 nginx: master process /opt/nginx/sbin/nginx www-data 18799 0.0 1.2 43552 6036 ? S 17:26 0:00 nginx: worker process deployer 19907 0.0 0.1 14516 900 pts/0 S+ 17:45 0:00 grep --color=auto nginx
So, my server user is www-data
.
Run these command after going into the project folder:
1. sudo chmod 777 ./assets
2. sudo chmod 777 ./assets/*
2. sudo chgrp www-data ./assets
3.sudo chmod g+w ./assets/