What can I do to fix the 504 gateway timeout error?

I am using jquery to try and fetch data from the API. However, I am getting a 504 error. Even when I use Postman to validate my data, this happens. Can anyone suggest what I need to do to get around this?

+3


source to share


1 answer


There is nothing you can do.

You send a request to the server. This particular request fails because the server sends a proxy request and receives a timeout error. Your server reports this to you as a 504 status.



The only way to fix this is to fix the proxy (make it respond in a timely manner) or change the server so it doesn't rely on that proxy. Both are outside your area.

You cannot prevent such errors. What you can do is figure out what the user experience should be when a problem like this occurs and implement it. BTW. If you are getting 504 errors then you should expect timeout errors as well. Let's say you make a request to your server with a 60 second timeout, and your server requests a proxy with a 60 second timeout. Since both timeouts are the same, sometimes your server will receive the proxy server timeout and send it to you (status 504), but sometimes your request to the server will timeout before that and you will get a timeout error.

+2


source







All Articles