This works: ~*\{.*\:\; 1; with map, do note that a 400 in logging means something else which precedes map handling. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,258636,258644#msg-258644