0

I have a GET call (long operation) from my front-end (angular code) to a webapi (hosted on IIS). To fix some CORS issue, I had to change the routing so that the call goes from browser to node first and then get routed to IIS.

Before: browser -> iis web api

After: browser -> node express (http-proxy-middleware) -> iis web api

The problem now is that the second call above times out exactly at 120s and IIS returns a 502.3 bad gateway (The operation has timed out) error. I tried changing the proxy options property (timeout and proxyTimeout) to different values, they kick in only if the value is below 120s. If I specify something greater than 120s, some invisible timeout kicks in at 120s.

My node is v12 and it has a default timeout of 120s, but changing it with server.timeout isn't helping. The http-proxy-middleware version is 2.0.6. I haven't made any changes to angular code or the iis hosted webapi code.

Noel
  • 83
  • 2
  • 2
  • 8
  • Try not to be over-creative. IIS has its own CORS support that you can easily configure, https://blogs.iis.net/iisteam/getting-started-with-the-iis-cors-module – Lex Li Dec 12 '22 at 02:01

0 Answers0