I think the best way is write a config generator by yourself with velocity or freemarker Posted at Nginx Forum: http://forum.nginx.org/read.php?2,208615,208912#msg-208912