inotify restart nginx on change code example Example 1: restart nginx sudo systemctl restart nginx Example 2: restart nginx in mac sudo nginx -s stop && sudo nginx