将 Web 应用程序移动到另一台服务器但使用相同的子文件夹和域
我的网络应用程序安装在服务器 A 上,例如
mywebsite.com/ -->转到服务器A mywebsite.com/myApp/ -->转到服务器 A
,出于性能原因,我希望在另一台服务器 B 上有 /myApp/ 但使用相同的域 mywebsite.com/ -->转到服务器A mywebsite.com/myApp/ -->转到服务器B
怎么办?
我在 MS 服务器上使用 MS .net 4、IIS 7。
谢谢
my web application is installed on a Server A like
mywebsite.com/
--> GO to Server A
mywebsite.com/myApp/
--> GO to Server A
and for performance reasons I would like have /myApp/ on an another Server B but using the same domain
mywebsite.com/
--> GO to Server A
mywebsite.com/myApp/
--> GO to Server B
How to do it?
I use MS .net 4, IIS 7 on MS Server.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您在服务器 A 和 B 前面是否有负载平衡器,以便您可以适当地引导流量?您是否有防火墙能够支持将流量与“/myApp”路由到 B 的规则?这些是我对在不更改服务器的情况下完成此操作的建议。但是,如果您确实必须更改服务器,我会考虑使用 ISAPI 过滤器将请求移动到另一台计算机,但这可能通过设置不同的域名来完成,以便您拥有 mywebsite.com 和 myapp .website.com,以便每个网站都可以解析到不同的服务器。如果您这样做,那么服务器 A 只需将请求重定向到其他服务器即可获得更简单的解决方案。无论如何,这是我能看到的几种不同的方法。
防火墙与负载均衡器的权衡实际上可能非常微小,因为许多大型站点都有负载均衡器和防火墙,尽管我质疑拥有负载均衡器与更改防火墙设置的成本差异。我还会调查每个选项对于您的情况的可行性。
Do you have a load balancer in front of servers A and B so that you could direct traffic appropriately? Do you have a firewall that may be able to support a rule to route traffice with that "/myApp" to go to B? Those would be my suggestions for ways to do it without changing the servers. However, if you did have to change the server, I would consider having an ISAPI filter that moves the requests to the other machine, but this is likely done better by setting up different domain names so that you have a mywebsite.com and a myapp.website.com so that each can resolve to a different server. If you do that, then server A just has to redirect the request to the other server for a simpler solution. Anyway, that is a few different ways to do it that I can see.
The trade-offs in firewall vs load balancer are really probably quite minuscule as many big sites have load balancers and firewalls, though I'd question the cost difference in having a load balancer versus changing firewall settings. I'd also investigate how feasible each option is for your situation.