Hallelujah! I finally got it to work with you great help. Thanks :) BTW - it was not perl_var but perl_set that did the trick, if anyone needs something like this in the future. Posted at Nginx Forum: http://forum.nginx.org/read.php?2,2598,2829#msg-2829