'if ($args ~ "&$") { return 400; }' Thanks a lot! Exactly what I needed :) Posted at Nginx Forum: https://forum.nginx.org/read.php?2,94128,280124#msg-280124