发送子域到node.js [英] Send subdomain to node.js
问题描述
我的工作在运行apache的ubuntu服务器(10.10)上运行了几个不同的内部Web应用程序.我目前正在开发另一个Web应用程序,并且正在认真考虑在定制的node.js Web服务器之上进行开发.我想这样做的原因是:
My work runs a couple different internal web apps on an ubuntu server (10.10) running apache. I'm currently developing another web app, and am seriously considering developing on top of a custom-built node.js web server. My reasoning for wanting to do this is:
- 速度/可伸缩性
- 安全性-页面将带有switch ...大小写,而不只是为(潜在恶意的)用户提供其所需的服务.
- 易于设置-我的意图是将其作为一个开源项目,并且node.js对于用户而言更易于设置,而不是处理apache/IIS/etc.
我的问题是,在让Apache监听端口80的服务器上,如何将某些子域传递给node.js.我看过几篇有关使用apache虚拟主机进行假冒的文章,但这似乎违反了使用node.js的目的.如果我必须经历apache,那么我避免apache/IIS的所有三个理由都使自己无效.
My question is, on a server where I've got apache listening to port 80, how can I pass off a certain subdomains to node.js. I've seen a couple articles about using apache virtual hosts to pass it off, but that seems to defeat the purpose of using node.js. If I have to go through apache, then all three of my reasons for avoiding apache/IIS have voided themselves.
我知道我可以使用其他端口(:8080?),但是从最终用户的角度来看,必须放入自定义端口非常令人困惑.还有其他想法吗?
I know I could use a different port (:8080?), but from an end-user standpoint, it's pretty confusing having to put in custom ports. Any alternative ideas?
谢谢
推荐答案
反之亦然:将节点绑定到端口80,处理以子域为目标的流量,并将其用作对所有内容都进行apache的反向代理还有吗?
How about doing things the other way round : bind node to port 80, handle the traffic targeted at the subdomain and use it as a reverse proxy to apache for everything else ?
这篇关于发送子域到node.js的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!