【问题标题】:Is it possible to use node.js server without having the Port number appear in the URL.是否可以在没有端口号出现在 URL 中的情况下使用 node.js 服务器。
【发布时间】:2015-05-30 16:18:15
【问题描述】:

我有一个使用 apache 端口 80 的 VPS,但想将 node.js 用于子域,没有端口节点将出现在地址栏中。

【问题讨论】:

  • 那么将该子域的 cname 指向另一台服务器(node.js 那个)?
  • 您实际上问的是“我可以将 apache 和节点绑定到同一个端口吗?”见gist.github.com/stagas/754303
  • 只有在他的服务器上有多个 IP 时才适用。
  • 它是基于名称的。一个IP

标签: node.js apache vps


【解决方案1】:

有可能

在您的 apache 虚拟主机文件中配置以下内容:

 <VirtualHost *:80>
  ServerName subdomain.myapp.com

 ProxyRequests off

<Proxy *>
        Order allow,deny
        Allow from all
</Proxy>

ProxyPass / http://localhost:3000/
ProxyPassReverse / http://localhost:3000/
ProxyPreserveHost on
</VirtualHost>

你应该有 名称VirtualHost *:80

【讨论】:

  • 这不会通过 apache 运行节点请求吗?
猜你喜欢
  • 2018-09-15
  • 2022-10-17
  • 2013-01-03
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2016-11-11
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多