我有一个在端口 80 上使用 apache 的 VPS,但想使用 node.js 作为子域,如果没有端口, Node 将出现在地址栏中。
最佳答案
是的,这是可能的
在您的 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>
你应该有 名称虚拟主机 *:80
关于node.js - 是否可以在 URL 中不显示端口号的情况下使用 Node.js 服务器。,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30548440/