nginx/launch

13 lines
350 B
Plaintext
Raw Normal View History

2016-04-20 17:40:22 +00:00
#!/bin/sh
# debug
# set -x
while true; do
inotifywait -e close_write,moved_to,create,delete /etc/nginx/conf.d
sleep 2
echo "INFO: nginx configuration change detected, attempting to load the new configuration ..."
nginx -t && nginx -s reload || echo "ERROR: nginx configuration has problems, thus cannot be reloaded."
done &
/usr/sbin/nginx