开发者

Using ASP.NET, setup a component to redirect response for any HTTP requests

开发者 https://www.devze.com 2023-01-13 03:50 出处:网络
The objective of this component is to be able to forward whatever HTTP requests it receives to forward to a different server based on the parameters but keeping the URL and POST data intact.For exampl

The objective of this component is to be able to forward whatever HTTP requests it receives to forward to a different server based on the parameters but keeping the URL and POST data intact. For example:

If the component receives

http://sourceserver/XYZ.aspx?id=100

It will return the response from either

http://targetserverONE/XYZ.aspx?id=100
http://targetserverTWO/XYZ.aspx开发者_高级运维?id=100

where XYZ can be valid name of the page. I think I can probably individually create each page to do a Response.Redirect but i am wondering if there is a more generic way to do this? In addition, is this something I have to configure on the IIS level rather than code level? Thanks.


You can do this in IIS from IIS Manager:

IIS 6 Instructions
IIS 7 Instructions

Edit: Just re-read your question and realize you're load balancing between two servers. You can do this at the administrative level as well. Google load balancing

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号