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.