location ~* ((.*)_([0-9]+)_([0-9]+)_([0-9]+)_([0-9]+)\.(gif|jpg|jpeg|png|JPG|PNG|GIF|JPEG))$
{
		if ( !-e $request_filename )
		{
			set $tow      $3;
			set $toh     $4;
			set $wforce      $5;
			set $hforce     $6;
			rewrite "((.*)_([0-9]+)_([0-9]+)_([0-9]+)_([0-9]+)\.(gif|jpg|jpeg|png|JPG|PNG|GIF|JPEG))" /thumb.php?file=$2.$7&tow=$3&toh=$4&wforce=$5&hforce=$6 last;
		}
		expires      30d;
}