快捷导航

阿里云上面用node.js + nginx搭建网站,每次访问都是‘welcom to ngin

我在阿里云上面用node.js + nginx搭建一个个人网站,但是每次访问都是‘welcom to nginx’提示server.js文件http.createServer(function(req, res){   const pathname = url.parse(req.url).pathname;   console.log(pathname);   switch(pathname){       case '':       case '/':         index(req, res);break;       default:         loadfiels(req, res, pathname);break;   }}).listen(9000, '0.0.0.0');用pm2运行这个文件,启动成功了:nginx 的配置conf/servers的文件下面有一个web.conf文件server {  listen       80;  server_name  tonghuiflang.com;  location / {      proxy_pass http://127.0.0.1:9000;  }}在conf/nginx.conf 和 conf/nginx.conf.default 的http最后 添加 include servers/*;可是通过域名访问还是‘welcom to nginx’提示,在本地是没有问题的

免责声明:本内容仅代表回答者见解不代表本站观点,请谨慎对待。

版权声明:作者保留权利,不代表本站立场。

回复

使用道具 举报

参与会员1

更新配置后重启 nginx 了吗?
回复

使用道具 举报

可能感兴趣的问答

发新帖
  • 微信访问
  • 手机APP