Nginx rewrite

Apache mod_rewrite:

RewriteCond %{QUERY_STRING} !^nobranding$
RewriteCond %{REQUEST_FILENAME} ^/assets/XL/([^.]+)\.([jpegif]+)$
RewriteCond /usr/local/www/assets-nz/XL/%1.branded.%2 -f
RewriteRule ^/([^.]+)\.([jpeg]+)$ /$1.branded.$2

nginx:

location /assets {
if ($args = nobranding) {
rewrite ^(.+)$ /nobranding$1 break;
}
rewrite ^/assets/XL/(.+)\.(jpeg|jpg|gif) /XL/$1.branded.$2;
root /usr/local/www/assets-nz;
error_page 404 = /nobranding/assets$uri;
}
location /nobranding/assets {
internal;
alias /usr/local/www/assets-nz/;
}

Другие примеры rewrite: