user2133617
user2133617

Reputation:

asp.net mvc web request says proxy error 502 only when deployed to iis

Hi i am creating some web requests through my controller in my asp.net MVC apps.To authenticate proxy i am using

System.Net.WebRequest.DefaultWebProxy.Credentials =  System.Net.CredentialCache.DefaultNetworkCredentials;

This works fine while making web request to external servers like e.g: http://www.google.com or whatever

but when i make request to my localhost it says proxy error and gives a error code 502. What could be the possible cause of this error? Any help really appreciated.

Upvotes: 1

Views: 2220

Answers (1)

user2133617
user2133617

Reputation:

It was the issue with IIS which actually doesn't read the host file so have to manually assign the proxy server and the bypass list to the web.config file. Good resource http://msdn.microsoft.com/en-us/library/31465c77.aspx

Upvotes: 1

Related Questions