Thanks Francis, that is an interesting approach (with a map). Will give it a try. And good point on only allowing pre-defined patterns to be passed from arg to root. Posted at Nginx Forum: https://forum.nginx.org/read.php?2,270868,270882#msg-270882