报错:

    1. > ./nginx -s reload
    2. nginx: [error] open() "/var/run/nginx/nginx.pid" failed (2: NO such file or directory)
    3. > cd /var/run/nginx
    4. -bash: cd: /var/run/nginx: 没有那个文件或目录

    先创建 缺失的目录,此时若依旧不能重启

    1. > mkdir /var/run/nginx
    2. > ./nginx -s reload
    3. nginx: [error] invalid PID number "" in "/var/run/nginx/nginx.pid"

    重新指定一次配置文件位置 即可解决

    1. > ./nginx -c /usr/local/nginx/conf/nginx.conf
    2. > ./nginx -s reload