在window环境下搭建nodejs,nginx反向代理、配置域名、80端口被占用解决方案

1.node.js下载地址    https://nodejs.org/en/ 

2.nginx下载地址   http://nginx.org/   

3.配置nginx.conf,打开nginx文件夹conf->nginx.conf

4.配置hosts,地址:C:\Windows\System32\drivers\etc

  

 

5.配置域名,在云解析上解析到当前云主机服务器的IP地址即可,比如域名为hahah.com,在hosts上配置 127.0.0.1 hahah.com

  

注意事项:由于80端口可能被占用,导致无法安装nginx

解决方案:1.被IIS或apache...等web服务占用,在cmd窗口,输入 net stop http ,关闭http服务,在进行安装即可

     2.开机自启动等软件占用80端口,sytem占用80端口,尝试使用: sc config http start= disabled  ,重启电脑

nginx命令行:

启动服务:start nginx
停止服务:nginx -s stop
重新加载:nginx -s reload(配置文件被修改后需要执行它) 

     

     

 

posted @ 2017-11-24 12:17  panle  阅读(2455)  评论(0编辑  收藏  举报