Search code examples
reactjsnode.jsaxiosrequestiis-10

Client request fails with 502 after 2 minutes


I have website on React. From client it sends the GET request using axios to the proxy server which waits for callback from the payment engine using EventEmitter. The issue is that GET request fails after 2 minutes with 502 error.

I tried to increase the timeout using IIS 10 (Windows Server 2019) connection timeout config from 120 seconds (2 minutes) to 900 seconds (15 minutes) but it still fails after 2 minutes. I tried to set the rule to the web.config: <serverRuntime idleTimeout="00:15:00" />

Also, I tried to set server.timeout directly to the proxy server (Node.js) but still no effect. When I enter all data very quickly in the payment form and it is submitted under 2 minutes then I get the JSON result correctly and GET request succeeds. Any ideas how to increase the timeout?


Solution

  • Ok. I have found the root of this issue and fixed it.

    In the IIS 10 -> Application Request Routing Cache -> Server Proxy Settings -> Time-out (seconds). By default it was configured to 120 sec - 2 min. I have changed it to 900 sec - 15 min. It works well. enter image description here

    Now, this issue is resolved. Thanks.