We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b503e5d commit 2d2fbadCopy full SHA for 2d2fbad
tools/nginx_config_monitor.sh
@@ -0,0 +1,16 @@
1
+#!/bin/bash
2
+
3
+while true; do
4
+ inotifywait --exclude .swp -e create -e modify -e delete -e move /etc/nginx/conf.d /etc/nginx/modules-enabled /etc/nginx/sites-enabled
5
6
+ # Test nginx config before attempting to restart.
7
+ nginx -t
8
+ if [ $? -eq 0 ]; then
9
+ # Config test passed - loading config.
10
+ echo "Detected Nginx Configuration Change"
11
+ echo "Executing: nginx -s reload"
12
+ nginx -s reload
13
+ else
14
+ echo "Config test did not pass. Please fix config and try again."
15
+ fi
16
+done
0 commit comments