I have an ASP.NET Core 2 web application which is hosted on IIS 10 on Windows Server 2012 without any load balancing and special configurations. For some MVC actions which takes too long we get a 502 HTTP error.
After seeing this error I was shocked, because I didn't have any configuration for a proxy server, etc. And then I remembered that the ASP.NET Core runs on Kestrel. So I came to this conclusion that here IIS plays the role of the proxy server and forwards the requests to the Kestrel. So I think this is somehow related to a timeout configuration, as the other parts of the application works very well. I have searched for similar questions on SO but no luck finding a solution.
I am getting same error when data is huge and take more time to execute web page, I have changed timeout value for .netcore in web.config
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule"
resourceType="Unspecified"/>
</handlers>
<aspNetCore requestTimeout="00:20:00" processPath="%LAUNCHER_PATH%"
arguments="%LAUNCHER_ARGS%" stdoutLogEnabled="false"
stdoutLogFile=".\logs\stdout" forwardWindowsAuthToken="false"/>
</system.webServer>
</configuration>
I have add requestTimeout="00:20:00"
in my existing web.config file and it works.
for reference go to this url
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With