My web api worked in several IIS, and when I switched to Azure VM, it gives net :: ERR_CONNECTION_RESET when called only from the ajax client, but it works correctly when using POSTMAN.
When hitting from the ajax hjml client, the OPTIONS message indicates net :: ERR_CONNECTION_RESET. I thought that he did not reach the server, but when accessing http the error file in
C: \ Windows \ System32 \ LogFiles \ HTTPERR
He 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 tried adding a timeout to web.config, it does not solve. Also tried to change the value of "Access-Control-Allow-Headers" in the web configuration "*", this gave a request error before the flight.
Since the same interaction with the server and the ajax client works in other iis, I suspect there is something suspicious that I lose when setting up my web api in IIS, which is located in Azure VM. When called from a POSTMAN or Android client, it works like a charm with an existing configuration in IIS.
Any help / suggestion is greatly appreciated.
source share