I can't access my application using my load balancer endpoint. However it works if I access the servers individually

Cloud 66 load balancers are brought up by default with an HTTP health check on the root of the application.

Why can’t my app use the Load Balancer

  1. Your application does not have anything on the root of the application. Therefore It returns HTTP 404 status. This will result in the load balancer assuming this endpoint is not healthy.

  2. Your application is redirecting HTTP to HTTPS on the application level. This means that when the load balancer does an HTTP health check, it receives an HTTP 301 status (redirection to HTTPS), which it does not follow, and concludes that the endpoint is not healthy (since it expects an HTTP 200 status).

What Should I Do

  1. Change your application’s manifest to a valid endpoint in your application. Redeploy your stack, and then recreate the load balancer (delete the current load balancer and bring up a new one).

  2. Switch off your application level redirection and instead enable HTTP > HTTPS redirection in the Cloud 66 dashboard. This can be found on your stack’s Network Setting > Redirects section. This will enable redirection on the web server, which we configure to correctly handle the load balancer health check.

Alternatively, if you want to keep your application level redirection. Create one endpoint that does not redirect to act as a health check endpoint (e.g. /health) and configure your load balancer to use that. This can be achieved via your application manifest file.