Multisite WordPress nginx uploaded files throw 404

I solved the problem by upgrading the way files are uploaded and displayed to the new WordPress 3.5 method.

A more detailed tutorial can be found at http://halfelf.org/2012/dumping-ms-files/ but the basic steps are as follows:

  • Move images from blogs.dir/#/files/ to /uploads/sites/#/
  • Change WordPress settings so it doesn’t look in /files/ but in /uploads/sites/#/
  • In .htaccess or your nginx config file remove ms-files.php line/section
  • Search/replace the posts table for each site, changing /files/ to /uploads/sites/#/