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.
then try access using the private url, it’s ok
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.