Delete the quotes and provide nginx with a statement of how to handle the rewrite: last or permanent?
last would be a simple rewrite without any status code and permanent will redirect the user (301 Moved Permanently).
Also type a break; statement after the rewrite rule.
So in the end, you would have one of the following:
[code]
rewrite ^/([a-zA-Z]{2,4})\/([0-9]{0,3})\/([0-9a-zA-Z]{0,6})\/([a-zA-Z0-9\-_,]*)\/(.*)\.png$ /test.bar last;
break;
[/code]
or
[code]
rewrite ^/([a-zA-Z]{2,4})\/([0-9]{0,3})\/([0-9a-zA-Z]{0,6})\/([a-zA-Z0-9\-_,]*)\/(.*)\.png$ /test.bar permanent;
break;
[/code]
Please tell us if this worked.
--------------------------------------------------------------------------------
//richard.fussenegger.info
//movlib.org