Nginx rewrite rules for fresh Wordpress 3.9.2 install with multisite


#1

I’m a bit confused about nginx rewrite rules for a fresh wordpress installation. Specifically, the tutorials listed on rtcamp don’t seem to follow the current directory structure that wordpress uses now. My understanding is that previously wordpress multisite used the /files directory. Now wordpress uploads files to /wp-content/uploads/sites/blogid/year/month.

I tried to alter the code but ended up breaking everything. Can anyone give me some insight as to what the best course of action is?

What should the code below be change to for the new directory structure?

map $uri $blogname{  
	~^(?/[^/]+/)files/(.*)	$blogpath ;  
}
}  
location ~ ^(/[^/]+/)?files/(?.+) {  
		try_files /wp-content/blogs.dir/$blogid/files/$rt_file /wp-includes/ms-files.php?file=$rt_file ;  
		access_log off;	log_not_found off; expires max;  
	}
    rewrite /files/$ /index.php last;  
   
    if ($uri !~ wp-content/plugins) {  
        rewrite /files/(.+)$ /wp-includes/ms-files.php?file=$1 last;  
    }

#2