Here is a small howto to show how to run nginx in a chroot on OpenBSD

First, compile nginx with the following flags (depending on the features you wish):
./configure --with-http_sub_module --with-http_flv_module --with-http_ssl_module --with-ld-opt="-static -static-libgcc" --with-cc-opt="-static -static-libgcc" --user=www --group=www
Depending on the version, you may have to edit src/os/unix/ngx_posix_config.h to change malloc.h in stdlib.h

then make && make install

mkdir -p /var/www/usr/local
mv /usr/local/nginx /var/www/usr/local/

mkdir /var/www/dev
cd /var/www/dev
mknod -m 0666 null c 2 2
mknod -m 0666 crypto c 70 0

mkdir /var/www/etc
echo "www:*:67:" > /var/www/etc/group
echo "www:*:67:67::0:0:HTTP Server:/var/www:/sbin/nologin" > /var/www/etc/master.passwd
pwd_mkdb -d /var/www/etc/ -s /var/www/etc/master.passwd

then start nginx as follows:
chroot /var/www /usr/local/nginx/sbin/nginx

Of course, your config should be based on path in chroot and your php or perl sockets must be in the path