Thanks this is work rewrite "^/(?:[A-Z]{3})(?:[a-z]{2})(?:[0-9]{4})(?:[a-z]{3})(?:[0-9]{4})(?:[A-Z]{2})(?:[a-z]{1})(?:[0-9]{1})/(.+)$" /files/$1 last; Posted at Nginx Forum: http://forum.nginx.org/read.php?2,190307,190345#msg-190345