Search code examples
macosnginx

Nginx reload error in mac osx


Greeting, i have a server installed nginx streaming i did stop nginx and then did reload it, but it show me below error and was not start:

nginx -s stop 
nginx: [error] open() "/usr/local/var/run/nginx.pid" failed (2: No     such file or directory) 

i did below command and nothing:

sudo nginx 
nginx: [emerg] open() "/usr/local/var/run/nginx.pid" failed (2: No such file or directory)

how i can resolve it? can anyone give me PID file content so i can creat it (Fake).

Thank you for your help.


Solution

  • I fix it by removing nginx.pid in /usr/local/var/run and then using brew services start nginx