Nginx-chroot is a project mainly written in Shell, it's free.
Script to chroot nginx on Ubuntu "Lucid" 10.04 LTS
Chrooting nginx for Ubuntu 10.04 LTS (Lucid) by Charles Phillips [email protected]
Jan 2011
Tested on Ubuntu 10.04 Minimal
Based on: http://www.cyberciti.biz/faq/howto-run-nginx-in-a-chroot-jail/
MIT Licensed, Use at your own risk
Note: install_files/n2chroot must be edited so that var BASE points to chroot directory. Accepting any patches so this isn't necessary!