This topic describes how to troubleshoot a health check exception of a layer-7 (HTTP/HTTPS) listener. The health check function is used to determine whether your backend servers are healthy. If a health check exception occurs, it generally means that your backend server is unhealthy. The exception may also be caused by incorrect health check configurations.

Procedure

  1. Make sure that the backend server does not block the CIDR block 100.64.0.0/10 through iptables or other third-party firewalls or security software.

    Server Load Balancer (SLB) communicates with backend servers by using IP addresses in the reserved CIDR block 100.64.0.0/10. If the CIDR block is blocked, health check exceptions occur and SLB cannot work normally.

  2. Access the HTTP service on the backend server from the backend server to check whether the HTTP service works normally.
    1. Log on to the SLB console and check the health check configurations on the listener details page.
      In this example, an HTTP listener is used and the internal IP address of the backend server with the health check exception is 10.0.0.2. Other health check configurations are as follows:
      • Health Check Port: 80
      • Health Check Domain Name (Optional): www.slb-test.com
      • Health Check Path: /test.html
    2. For a Linux server, run the nc or curl command to test the HTTP service on the backend server. Make sure that the configurations of health check path, health check port, and health check domain name are the same for the HTTP service and the backend server. Otherwise, a health check exception occurs.
      In this example, the nc command is used. Configure the health check path, health check domain name, public IP address, and health check port according to your actual situation.
      echo -e "HEAD /test.html HTTP/1.0\r\nHost: www.slb-test.com\r\n\r\n" | nc -t 172.17.58.131 80
      • In normal conditions, 200 or 2xx/3xx status codes are returned, as shown in the following figure.
      • Assume you do not change the listener configurations of the SLB instance but delete the /test.html page on the backend server. Then, when you run the nc command, the error code 404, instead of 2xx or 3xx, is returned, indicating a health check exception, as shown in the following figure.