简体   繁体   English

ASP.NET MVC Web请求仅在部署到IIS时才说代理错误502

[英]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.

相关问题 部署在 IIS 上的 ASP.NET Core 为长时间运行的请求返回 502 错误 - ASP.NET Core deployed on IIS returns 502 Error for long running requests ASP.Net Core Web API 适用于 IIS Express,但在部署到 IIS 时不起作用 - ASP.Net Core Web API works on IIS Express, but not working when deployed to IIS 使用ASP.NET MVC发送新闻稿时出现IIS错误 - IIS error when sending newsletter using ASP.NET MVC 在 ASP.net Mvc 应用程序中的 IIS 中部署应用程序时,水晶报表无法加载 - Crystal report fails to load when application is deployed in IIS in ASP.net Mvc app 用于检索所有用户的ASP.NET MVC Active Directory代码在部署到IIS 7时停止工作 - ASP.NET MVC Active Directory code to retrieve all users stops working when deployed to IIS 7 IIS部署的ASP.NET Core应用程序出现间歇性431请求标头过长的错误 - IIS Deployed ASP.NET Core application giving intermittent 431 Request headers too long error 如何在ASP.NET MVC 5中调用SOAP Web服务时修复502 Bad Gateway错误? - How to fix 502 Bad Gateway error when calling SOAP webservice in ASP.NET MVC 5? 仅在 UAT web 服务器中部署时出现路由错误 404。 在当地工作。 ASP.NET核心 - Routing error 404 only when deployed in UAT web server. Works locally. ASP.NET Core ASP.NET:相对路径在部署IIS时不起作用 - Asp.net: relative paths not working when deployed IIS 在IIS上部署时,ASP.NET 4.5身份验证重定向不起作用 - ASP.NET 4.5 Authentication Redirect Not Working When Deployed on IIS
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM