码迷,mamicode.com
首页 > Windows程序 > 详细

window nginx 启动无提示错误,却没有listen 80port

时间:2016-03-21 21:26:26      阅读:369      评论:0      收藏:0      [点我收藏+]

标签:

一直使用虚拟机来使用web+hostonly方式;

今天为了測试一个php平台的window系统兼容性,

在官方下载了window-nginx 1.9.1版本号;

解压到文件夹,

执行nginx.exe

訪问127.0.0.1正常;

于是改动nginx.conf把里面的server{}所有删除替换成include ./vhost/*.conf;

在conf文件夹下建立vhost文件夹同一时候从centos中复制出一个site的server conf文件出来,改动一下root指向的文件夹.保存;

使用nginx.exe -t測试都OK;

使用nginx.exe &启动;

使用127.0.0.1訪问发现无法訪问;

使用netsat -anb没有发现80port出现;

查看error.log也没有发现错误.折腾好大一会.没有结论;

不得已还原nginx.conf,訪问正常;

再简单的在http{}内部加上include ./vhost/*.conf;

再訪问127.0.0.1,也是正常的.就是訪问我那个site却不行?

config test也提示是OK的;

奇怪了,突发奇想,把vhost中那个conf内容移入nginx.conf试试;

一移动,使用config test測试就提示:nginx: [emerg] the unix domain sockets are not supported on this platform in upstream "unix:/run/php-fpm/php-fpm.sock" in D:\web\nginx/conf/nginx.conf:73

原来是那个server中原来cenots以下的配置无效,可是放到include中却总看不到错误提示,而被忽略这个server导致的;


所以这里得到结论:这应该是nginx的错误提示的bug,可是我们眼下在配置过程,尽量在nginx.conf的主配置文件上做配置没有问题了,再移入分文件,

就能够通过错误提示我们一步一步的把配置搞好;

window nginx 启动无提示错误,却没有listen 80port

标签:

原文地址:http://www.cnblogs.com/mengfanrong/p/5303759.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!