Windows 上的反向代理
我有一个 Web 服务器,可以响应端口 80 上的多个不同站点。目前,IIS 通过主机标头映射到各个站点,但我希望能够在 Jetty 或托管的端口 80 上为其他 Web 应用程序提供服务雄猫。 IIS 通过抓取所有端口 80 流量来防止这种情况发生。
我基本上需要一个反向代理来将端口号更改为另一个应用程序堆栈可以侦听的端口号。我正在研究 nginx,但它似乎还没有为 Windows 上的黄金时段做好准备。最终我可能会专门为此设置一个 Linux 机器,但现在我对一个可以在同一个机器上运行的解决方案感兴趣。
我真正需要的是一些非常轻量级的东西,主要是匹配主机名/端口并允许重写端口。有人有什么建议吗?
I have a web server that responds to a number of different sites on port 80. Currently, IIS does the mapping to various sites via host headers, but I'd like to be able to serve other web apps on port 80 hosted in Jetty or Tomcat. IIS prevents that by grabbing all port 80 traffic.
I basically need a reverse proxy to just change the port number to something that another app stack can listen in on. I was looking into nginx but it seems to not be quite ready for prime time on Windows. Eventually I may set up a Linux box specifically for this, but for now I'm interested in a solution which will run all on the same box.
All I really need is something very light which mostly just matches hostname/port and allows rewriting of the port. Does anyone have any suggestions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果您在 IIS 7 或更高版本中运行,则可以使用应用程序请求路由:http://www.iis .net/download/ApplicationRequestRouting
If you are running in IIS 7 or above you can use Application Request Routing for that: http://www.iis.net/download/ApplicationRequestRouting
对于 IIS 5-6,Apache Tomcat Connector (JK 1.2) 看起来是一个干净的解决方案。这是一个 IIS ISAPI 过滤器,它允许 IIS 充当其他 Web 服务器的反向代理。它使用 Apache JServ 协议 (AJP) 与实际处理请求的应用服务器进行通信。 Tomcat 和 Jetty 都实现了 AJP。 URL 使用类似正则表达式的配置映射到特定的 AJP 服务器实例。
此 ISAPI 插件 也适用于 IIS 7.x,但在这种情况下,应用程序请求路由 (查看标记的答案)应该被考虑,因为它可能在非 AJP 服务器上工作得更好。
For IIS 5-6, it looks like Apache Tomcat Connector (JK 1.2) is a clean solution. This is an IIS ISAPI filter which allows IIS to act as a reverse proxy for other web servers. It uses Apache JServ Protocol (AJP) to communicate with the app server actually serving requests. Both Tomcat and Jetty implement AJP. URLs are mapped with regex-like config to a particular AJP server instance.
This ISAPI plug-in also works with IIS 7.x, but in that case the Application Request Routing (see marked answer) should be considered as it might work better with non-AJP servers.