MostXlent1
MostXlent1

Reputation: 123

Images not visible on site after FTP upload on NGINX server

I am trying to give someone FTP access to an NGINX /var/www/sitename folder on an Ubuntu server so they can upload development files. I have created a user 'developername' and assigned them to the 'www-data-' group. They are able to upload files, but the images (apparently only the images) are not displaying on the site. I need to SSH in and change all of the files to www-data:www-data in order for them to display correctly.

I'm trying to find a way for this user to upload files and either automatically change them to www-data:www-data or to allow NGINX to use the developername:www-data files. Do you have any ideas?

I've just been using git for a couple of years now and had tried my best to not use FTP at all anymore... This setup is a little infuriating.

Thanks for your time and any responses!

Upvotes: 1

Views: 486

Answers (1)

MostXlent1
MostXlent1

Reputation: 123

In case someone else runs into this, I first got uploaded files to automatically be in the correct group by doing this:

chmod g+s root_web_folder_name

This made all uploaded files already have the www-data group. Then I went and updated the local_umask setting in the vsftpd.conf file:

local_umask=0002

Now images are appearing when the developer uploads new files. Make sure to set permissions correctly there, I just have it lax because it's a quick test site.

Upvotes: 2

Related Questions