cd /var/www/
(Jump to the directory first where you want to set permissions)sudo chown -Rv root:$USER .
(The Dot is inclusive. Same for below)sudo chmod -Rv g+rw .
sudo chmod a+rwx /path/to/file
(Use this command for write permissions)- Now try creating a folder
location / {
try_files $uri $uri/ /index.html;
}