My web api was working in several IISs and when moved to Azure VM, it gives net:: ERR_CONNECTION_RESET when calling only from ajax client but works proper when using POSTMAN.
When hitting from ajax html client it says net:: ERR_CONNECTION_RESET in OPTIONS request. Thought that it didnt reach the server but when referring http error file in
C:\Windows\System32\LogFiles\HTTPERR
It shows
2017-07-20 12:54:06 210.18.173.26 54141 10.0.1.4 80 HTTP/1.1 OPTIONS /api/User/Method1 - 1 Request_Cancelled myappapipool
In web.config
<add name="Access-Control-Allow-Origin" value="*" />
<add name="Access-Control-Allow-Headers" value="Content-Type" />
<add name="Access-Control-Allow-Credentials" value="true" />
<add name="Access-Control-Allow-Methods" value="GET, POST, OPTIONS" />
I have tried adding timeout in web.config, it is not solving. Also tried changing the web config "Access-Control-Allow-Headers" value to "*", it gave preflight request error.
Since the same server and ajax client communication is working in other iis, i suspect there is something fishy which i missing while configuring my web api in IIS which is located in Azure VM. When calling from POSTMAN or android client it is working like a charm with the existing configuration in IIS.
Any help/suggestion is much appreciated.
If you're receiving the ERR_CONNECTION_RESET error message, it means that your internet browser is unable to connect to the target website's server.
Request_Cancelled Coming in HTTPErr log is caused by the DynamicIPRestrictions Module mitigating against DDOS attacks.
if you setup Dynamic IP Restrictions with "Deny Action Type" set to "Abort Request", the requests will be aborted and logged as "Request_Cancelled" in the HTTPErr log
By default Dynamic IP Address Restrictions may abort the request if more than 5 concurrent requests come(check what is the configured setting in your server.) And that may be reason why it works for one server and does not work in Azure environment.More details can be found on Security guidelines to detect and prevent DOS attacks targeting IIS/Azure Web Role (PAAS)
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