Why does my load balancer respond with a 504 Gateway Timeout error?

When a load balancer’s connection remains idle for 60 seconds, it times out and responds with a 504 Gateway Timeout error. If your application requires longer than 60 seconds to respond, you can increase the load balancer’s timeout settings in its Settings tab.

Load balancers return 503 errors when there are either no Droplets assigned to them or all of the assigned Droplets are unhealthy.
Health checks often fail due to firewalls or misconfigured backend server software.