Nginx Rewrite - WP3 MS + BP + WPMUDev Plugins

Its not a question but more towards a solution for those who are interested in walking this path. I was developing my site in WPMU but with WP3 just round the corner I thought it wiser to go down this path.

Couldn't find a working solution online so came up with my own that appear to work across the board so posting here for other peoples benefit.

Reasons why i came up with this solution is that my old WPMU Nginx Rewrites that I got working using WPMU 2.9.2 didn't work with WP3 as there are some core file changes in WP3, the usual BP Avatar upload/display issues you have with Nginx, plus I also noticed that whilst the Media Library images would display the first time round if you did a simple refresh in your browser they would disappear.

location / {
root /www/root;
index index.php;

gzip on;
gzip_http_version 1.0;
gzip_vary on;
gzip_comp_level 3;
gzip_proxied any;
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
gzip_buffers 16 8k;

if (!-e $request_filename) {
rewrite ^.+/?(/ms-.*) $1 last;
rewrite ^/files/(.+) /wp-includes/ms-files.php?file=$1 last;
rewrite ^.+/?(/wp-.*) $1 last;
rewrite ^.+/?(/.*\.php)$ $1 last;
rewrite ^(.+)$ /index.php?q=$1 last;
expires 10d;
break;

}
}

location ~* ^.+.(html|jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|js)$
{
root /www/root;
rewrite ^/.*(/wp-.*/.*.(html|jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|js))$ $1 last;
rewrite ^.*/files/(.*(html|jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|doc|xls|exe|pdf|ppt|txt|tar|mid|midi|wav|bmp|rtf|js))$ /wp-includes/ms-files.php?file=$1 last;
if (!-e $request_filename) {
rewrite ^.+/?(/wp-.*) $1 last;
rewrite ^.+/?(/.*.php)$ $1 last;
rewrite ^(.+)$ /index.php?q=$1 last;
}

expires 30d;
break;
}

They're not perfect but they seem to work as far as I can tell. Just waiting on the final release of WP3 and the release of the WPMUDev plugins to match. In the meantime I will see if I can refine them a bit more.