As usual, my fault ;) The problem was the "rule order". if (!-e $request_filename) { rewrite ^(.*)$ /index.php last; break; } rewrite "^/({2})/?$" /index.php?country=$1 last; The first rule stopped the second one from working. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,1026,1045#msg-1045