[英]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 嗨,我正在通过我的asp.net MVC应用程序中的控制器创建一些Web请求。我正在使用身份验证代理
System.Net.WebRequest.DefaultWebProxy.Credentials = System.Net.CredentialCache.DefaultNetworkCredentials;
This works fine while making web request to external servers like eg: http://www.google.com or whatever 在向外部服务器(例如http://www.google.com)发出Web请求时,此方法效果很好
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? 但是当我向本地主机发出请求时,它说代理错误并给出错误代码502。此错误的可能原因是什么? Any help really appreciated.
任何帮助真的很感激。
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. 这是IIS的问题,它实际上不读取主机文件,因此必须手动将代理服务器和旁路列表分配给web.config文件。 Good resource http://msdn.microsoft.com/en-us/library/31465c77.aspx
良好的资源http://msdn.microsoft.com/en-us/library/31465c77.aspx
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.