Nginx启动失败的解决方案

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

  ➜ nginx sudo nginx -c nginx.conf
  nginx: [emerg] open() "/usr/local/Cellar/nginx/1.10.2_1/nginx.conf" failed (2: No such file or directory)

 

执行上面的两个命令都失败,原因是指定nginx的配置文件时需要使用绝对路径。

➜  nginx sudo nginx -c /usr/local/etc/nginx/nginx.conf
➜  nginx sudo nginx -s reload

成功启动Nginx

转载于:https://www.cnblogs.com/xiaomingliu/p/7885239.html

你可能感兴趣的:(运维)