我目前对节点感兴趣,所以我想为我的公司构build一个小应用程序。 我们有一个Apache web服务器来处理我们当前的web应用程序。 我的问题是,我怎样才能在同一台服务器上托pipe节点应用程序,而不必让应用程序的用户input端口号? IE:
我的主要服务器IP是:123.456.789
myapp.com/ – 去主服务器(端口80)mynodeapp.com/ – >去主服务器(但应用程序运行在端口3000)
我如何让mynodeapp.com去到主服务器,但知道使用端口3000(没有我的用户input端口在URL中)?
我假设我必须让stream量进入80端口,并让Apacheredirect? 谢谢,我不是服务器pipe理员,我知道只是让我陷入困境:)
# The *:80 part must match the config of your existing virtual host(s), and # a NameVirtualHost directive in your main config somewhere. <VirtualHost *:80> # This determines what requests get sent to this virtual host: ServerName mynodeapp.com # Proxy all requests to the port 3000 listener: ProxyPass / http://127.0.0.1:3000/ # This handles the translation of the location header in 30x responses: ProxyPassReverse / http://127.0.0.1:3000/ </VirtualHost>
如果您的现有configuration不使用虚拟主机,则需要首先进行其他调整 – 提供有关现有configuration的更多详细信息,我们可以提供帮助。