问题

执行

nginx -s stop 或者 >nginx -s reload

报错信息如下

nginx: [error] CreateFile() "E:finance-project-master-preparenginx-1.18.0/logs/nginx.pid" failed (2: The system cannot find the file specified)

执行

nginx -t

报错信息如下:

nginx: the configuration file E:finance-project-master-preparenginx-1.18.0/conf/nginx.conf syntax is ok
nginx: [emerg] bind() to 0.0.0.0:80 failed (10013: An attempt was made to access a socket in a way forbidden by its access permissions)

同时,访问localhost:80会发现
在这里插入图片描述

解决方法

由此可见,80端口被占用,执行命令

 netstat -aon|findstr "80"

在这里插入图片描述
发现是19404进程占用了80端口,在任务管理器中找到19404进程右键结束任务
在这里插入图片描述
执行

start nginx

结果

最后发现,nginx可以正常访问
在这里插入图片描述

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注