i want to rewrite: http://a.com/abcde.jpg to http://a.com/ab/cde.jpg here is my nginx config: rewrite "^/({2})({3})\.jpg$" /$1/$2.jpg last; but it not works