changed rewrite to return as rewrite isn't needed
changed 'http' to scheme incase nginx is also doing https
keep arguments as there's no reason to drop them
made static extensions match .htaccess
deny access to lib and pages directory, and hidden files to match .htaccess files
change default index to index.php
made nginx config more portable to the changing of the webroot.