504 Gateway Timeout NGinx

I am running into a 504 gateway timeout error with my express API. I have a droplet using docker-compose to spin up all the resources. When doing research into the issue people say usually you run out of ram but my memory is only at 60%. I think this is more of a load balancer issue but am unaware of the steps to proceed. I added the client_header_timeout config to nginx.config but that didn’t solve the issue. Any insights would be appreciated.

Submit an answer
Answer a question...

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Bobby Iliev
Site Moderator
Site Moderator badge
March 23, 2022


I could suggest checking your logs to see if there is some more information on why the connection could be timing out:

docker-compose logs

Feel free to share the logs here after removing any sensitive information.

Also, another thing, if you wish you could share your docker-compose.yaml file here along with your Nginx config and I could have a further look into this.