#/bin/sh

RESOLVER=$(cat /etc/resolv.conf | grep nameserver | head -1 | sed -n -e 's/^nameserver //p')
echo "Attempting to use nameserver: $RESOLVER"
sed -i 's/replace-resolver-value-here/'$RESOLVER'/g' /etc/nginx/nginx.conf

ln -sf /dev/stdout /var/log/nginx/access.log && ln -sf /dev/stderr /var/log/nginx/error.log
nginx
