开发者社区 问答 正文

定向域名到IP+端口

大家好,请问一下怎么定向域名到IP+端口呢?我租了个轻量级应用服务器cent.OS + Node.js。我将我的web代码上传到root目录里,然后用node 指令运行我写的server.js。 (监听端口自己设置的为8000) ,我也在防火墙里面添加了自定义的端口。 现在我输入我服务器的IP+8000 可以在任何设备上运行了。但是我输入 www.xxxxxx.com(我购买的域名) 还是显示 An error occurred. Sorry, the page you are looking for is currently unavailable. Please try again later.

If you are the system administrator of this resource then you should check the error log for details.

Faithfully yours, nginx

请问我该怎么配置nginx呢? 我看到nginx文件夹里有html文件夹。我应该把我的web代码放入在htm文件夹l里?

求指导 谢谢!

展开
收起
游客2kgiktcxnofr6 2019-11-07 15:51:26 942 分享 版权
1 条回答
写回答
取消 提交回答
  • 这个很简单

    server { listen 80; server_name www.stardust.com location / { proxy_pass http://localhost:8210; index index.html; } }

    2019-11-08 00:41:09
    赞同 展开评论