nginxcloudbackendreverse-proxydigital-ocean

Nginx Load Balancer Configuration Issue with DigitalOcean Droplets


I'm facing an issue with configuring an Nginx load balancer on my DigitalOcean droplets. The problem is that the load balancer is not routing traffic properly to the backend servers, resulting in a "503 Service Unavailable" error.

I have configured a health check route within my Express.js application to respond with a 200 OK status on the private IP addresses of the backend droplets


Solution

  • I find the solution.Turns out the problem was the firewall enabled on the droplet blocking traffic to port 5000.

    UFW: https://www.digitalocean.com/community/tutorials/how-to-set-up-a-firewall-with-ufw-on-ubuntu-18-04 ; IPTables: https://www.digitalocean.com/community/tutorials/iptables-essentials-common-firewall-rules-and-commands