如遇到启动nginx报这个错误
An attempt was made to access a socket in a way forbidden by its access permissions
原因可能是默认80端口被占用了,这时我们可以修改conf/nginx.conf把80端口改成90或其他
修改如下:
server {
listen 90;
server_name localhost;
修改完成后,重新启动nginx
nginx-1.14.2> start nginx.exe
如果直接reload的话
nginx-1.14.2> nginx -s reload
会报以下错误
CreateFile() "C:\nginx-1.14.2/logs/nginx.pid" failed (2: The system cannot find the file specified)
主要是因为log/nginx.pid文件不存在,无法根据nginx进程id重启。
写到最后,欢迎关注作者:http://fenxianglu.cn/
网友评论