Images no longer served on WP site

May 21, 2014 1.6k views
Hi, I updated plugins two days ago and ever since the images on the WP multisite no longer show. One was a security plugin and the other nginx helper plugin. The images now do not show in a browser. SSH shows the files are present. I can go into the WP admin panel and click on edit the image and it'll show but once saved then it goes back to 'broken image.' I'm sure this is a permissions issue because I tried to use Filezilla and change permissions for some files and an error was returned that the account didn't have permission - odd - since it always did ... How can I chmod directories to the correct permissions, file uploads to the correct permissions, etc?
3 Answers
Make sure the owner/group of the folders is www-data. Generally speaking, all sites should have that as the owner/group, though it of course depends on your set up.

# sudo chown -R www-data:www-data /var/www/yourwordpress-install

That will make everything in your folder have the www-data user and group set to them. If you need your permissions updated as well, you can add yourself to the www-data group.

# sudo useradd -g www-data yourusername

That should allow you to change the file permissions using FileZilla. But if you want to do that using the command line, it'll be something like

# sudo chmod 0755 /var/www/yourwordpress-install/wp-content/uploads

Change the directories in the commands to reflect your folder structure.

Thank you for answering my question but I'm finding out that the permissions are in fact correct. Instead, file paths are wrong. I never changed them but something changed them... maybe the nginx helper plugin.

The image is called correctly here:

But WordPress is calling it here:

So - did nginx conf get changed by the WP nginx helper plugin? How do I get this working so the images show? I have deleted the nginx helper plugin but still cannot get images to load properly.
Ah, I haven't used that plugin before, but I see it looks like it adds redirects, so that could be it. What's your nginx conf looking like?
Have another answer? Share your knowledge.