首先检查nginx能否正常启动
cd /usr/local/nginx/sbin
./nginx -s reload //热更新
出现以下报错
nginx: [emerg] "tcp_nodelay" directive is duplicate in /usr/local/nginx/conf/nginx.conf:41 nginx: [error] open() "/usr/local/nginx/logs/nginx.pid" failed (2: No such file or directory)
打开nginx配置文件
vi /usr/local/nginx/conf/nginx.conf
注释以下出错行
41行报错 #tcp_nodelay on;
然后指定nginx配置文件目录
/usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
再次热更新nginx 查看有无报错