I am assuming your sftp login user is 'sftp_user'. generally you dont want to make your home to a directory where you don't want to add misc config files.
if the group "nginx" has read/execute and write if you want that, you can add user 'sftp_user' to group 'nginx'
to check for permissions on '/var/www', execute
ls -l /var
- output should contain something like
drwxr-xr-x 12 nginx nginx 4096 Sep 28 2021 www/
- In this example, group 'nginx' has read/execute permission
To add user 'sftp_user' to group 'nginx'
sudo usermod -a -G nginx sftp_user
- this will give read/execute permission to /var/www
To add write access to group 'nginx'
sudo chmod g+w /var/www
- might want to check if nginx will have any problems with group write permission will be a security problem
I use apache but it probably is the same with nginx, What i did was changed the user of '/var/www/example.org/htdocs' to my username, instead of modifying group permissions.
- to change the all files and directorys to have user 'myuser'
- `sudo chown myuser:www-data -R /var/www/example.org/htdocs
For you it would be
sudo chown sftp_user:nginx -R /var/www
- but again you many want to check if there is any issues with thing on nginx