search

Home  >  Q&A  >  body text

node.js - node 绑定域名

我的域名绑定了ip 我的node监听的是80端口 使用ip可以直接看到页面不加端口 我自己试了别的端口 我绑定3000端口 只要ip或者域名后面加:3000都可以访问 如果我监听80怎么弄才能直接域名就访问

天蓬老师天蓬老师2783 days ago746

reply all(6)I'll reply

  • PHP中文网

    PHP中文网2017-04-17 13:21:34

    Configure a reverse proxy server for distribution, you can use nginx or apache. You can even write it directly in nodejs. The recommended npm module is http-proxy, you can give it a try.

    reply
    0
  • 伊谢尔伦

    伊谢尔伦2017-04-17 13:21:34

    Is this the case? What error does the browser report? 404? Also, is the IP returned by the ping URL the bound IP?

    reply
    0
  • PHP中文网

    PHP中文网2017-04-17 13:21:34

    You need to configure an nginx

    reply
    0
  • 大家讲道理

    大家讲道理2017-04-17 13:21:34

    This is a problem with the cooperation between Nodejs and nginx; just configure nginx.

    reply
    0
  • 高洛峰

    高洛峰2017-04-17 13:21:34

    If you listen to port 80, you can access it using the domain name

    reply
    0
  • 巴扎黑

    巴扎黑2017-04-17 13:21:34

    How to solve this problem and what to do next after using npm http-proxy

    reply
    0
  • Cancelreply