brew restart nginx code example Example 1: restart nginx in mac sudo nginx -s stop && sudo nginx Example 2: restart nginx mac brew services restart nginx