CodexBloom - Programming Q&A Platform

OCI Load Balancer Health Check scenarios for Node.js Application Despite Correct Configuration

πŸ‘€ Views: 142 πŸ’¬ Answers: 1 πŸ“… Created: 2025-06-09
OCI Load Balancer Node.js JavaScript

I'm getting frustrated with I've been banging my head against this for hours... I've encountered a strange issue with After trying multiple solutions online, I still can't figure this out. I'm experiencing issues with the health checks for my OCI Load Balancer that is intended to route traffic to a Node.js application. I have set up the load balancer to point to my backend service running on port 3000, but it keeps failing the health checks, and I'm unable to figure out why. Here’s the health check configuration I have: - **Protocol**: HTTP - **Port**: 3000 - **Health Check Path**: /health - **Response Code**: 200 The `/health` endpoint of my Node.js application is supposed to return a simple JSON response: ```javascript app.get('/health', (req, res) => { res.status(200).json({ status: 'UP' }); }); ``` I've tested the `/health` endpoint directly from my browser and using `curl` from another machine within the same VCN, and it returns the expected response: ```bash curl -i http://<backend-ip>:3000/health ``` This returns: ``` HTTP/1.1 200 OK Content-Type: application/json; charset=utf-8 { "status": "UP" } ``` However, the OCI Load Balancer health check keeps failing with the following behavior message in the console: ``` Health check failed for instance <instance_id>, HTTP response code: 503 ``` I've also checked the security rules associated with the subnet where my application is running, and they allow inbound traffic on port 3000 from the load balancer's IP range. I tried enabling logging for the load balancer but didn’t see any additional helpful information. Could there be any specific configuration or best practices I might have overlooked that would affect the health checks? Any suggestions on how to diagnose or solve this scenario would be greatly appreciated! I'm working on a CLI tool that needs to handle this. I'd really appreciate any guidance on this. I recently upgraded to Javascript latest. I'd really appreciate any guidance on this. Is there a better approach? This is for a CLI tool running on CentOS. What's the correct way to implement this? I'm working with Javascript in a Docker container on Linux. What am I doing wrong? I'm working in a Ubuntu 22.04 environment. Any advice would be much appreciated.