How to restart nginx on OS X

后端 未结 13 1022
无人共我
无人共我 2021-01-30 04:53

I\'m using nginx on OS X 10.8. Freshly installed nginx but can\'t find a way to restart nginx except kill nginx_pid say kill 64116

相关标签:
13条回答
  • 2021-01-30 05:45

    To reload the custom config file use

    nginx -s reload -c /etc/nginx/conf.d/<config file>.conf
    
    0 讨论(0)
  • 2021-01-30 05:46

    i got the same error link you, i tried many way to fix it but it not working after that i run the command line and it work well: nginx -c /usr/local/etc/nginx/nginx.conf

    the information i got from here https://blog.csdn.net/wn1245343496/article/details/77974756

    0 讨论(0)
  • 2021-01-30 05:50

    This could simply mean that nginx is already stopped - not running at the moment.
    First, confirm whether nginx is running, execute:

    $ ps aux | grep nginx
    
    0 讨论(0)
  • 2021-01-30 05:52

    I do it like this:

    First kill the progress

    ps aux | grep nginx
    kill -9 {pid}
    

    Then start nginx

    nginx
    

    It works!

    0 讨论(0)
  • 2021-01-30 05:54

    Try running sudo nginx before starting nginx.

    0 讨论(0)
  • 2021-01-30 05:54

    Try this:

    sudo nginx -s stop

    followed by a:

    sudo nginx

    It seems that nginx keeps track of its state, to if you stop it twice, it will complain. But the above worked for me.

    0 讨论(0)
提交回复
热议问题