Nginx rewrite rule not working (used to work on Apache)

view story

http://serverfault.com – I have these rewrite rules (I tried both with no avail): location ~* "^/([a-z0-9]{32})\.png$" { rewrite ^ /index.php?page=log&id=$1 last; } and location ~* "/(?<hash>[a-z0-9]{32})\.png" { rewrite ^ /index.php?page=log&id=$hash; } and location / { try_files $uri $uri/ @rewrites; } location @rewrites { rewrite "^/([a-zA-Z0-9]{32})\.png$" /index.php?page=log&id=$1 last; #... } Basically, I want the URL http://example.com/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.png to actually pass the parameters to my index.php script, and in the script, I got: $db->save_hash($ (HowTos)