Got a weird problem, here is the quick story. I have several Web servers with the web app binding to private port 8011. the Load balancer has a Name like LB. when the page display the request Uri. it returns very weird format. http://LB:8081 (so basically, LB name + Private Port) , no body can access this Url.
To do the simple test. I setup one test page on IIS with port8011, return the current URL.
then try access using the private url, it’s ok
However, if I setup one LB with LB_NAME, and LISTEN on Port 8888. then I try access the LB address. get unreachable url.
then I check the code, for .net 4.0. it has the option to follow the Url from the user request. add one setting called aspnet:UseHostHeaderForRequestUrl
then we get the url as user sent in the request
If you check the .net 4.0 code, it has the following logic to get URL.
But this only applies to .net fx with latest patch. so check the code using reflector in your real case.
No comments:
Post a Comment