.Net Core 3.1 API returning 524

I have an API written with Asp net core 3.1

With the VIN code received in the post method, I apply to an external api service, get the machine data, write the incoming data to the database and return it in response. However, the external api service can return the data too late. (for example, 3-4 minutes) In this case, even though my code is fully functional, it brings the data and writes it to the database, but in the end, error 524 returns.

I did not encounter this error in my project local and Windows server. It mostly happens on my linux server in production.

Can you help solve the problem?

How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum