80端口无法访问 但其他端口正常

时间:2024-03-12 15:05:38

首先检查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 查看有无报错