# nginx_upstream_check_module **Repository Path**: hwh_2021/nginx_upstream_check_module ## Basic Information - **Project Name**: nginx_upstream_check_module - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-05-15 - **Last Updated**: 2026-05-15 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ## nginx_http_upstream_check_module support upstream health check with Nginx ## example ```nginx http { upstream cluster { # simple round-robin server 192.168.0.1:80; server 192.168.0.2:80; check interval=5000 rise=1 fall=3 timeout=4000; #check interval=3000 rise=2 fall=5 timeout=1000 type=ssl_hello; #check interval=3000 rise=2 fall=5 timeout=1000 type=http; #check_http_send "HEAD / HTTP/1.0\r\n\r\n"; #check_http_expect_alive http_2xx http_3xx; } server { listen 80; location / { proxy_pass http://cluster; } location /status { check_status; access_log off; allow SOME.IP.ADD.RESS; deny all; } } } ``` ### Description Add the support of health check with the upstream servers. ## Directives ### check + syntax > check interval=milliseconds [fall=count] [rise=count] [timeout=milliseconds] [default_down=true|false] [type=tcp|http|ssl_hello|mysql|ajp|fastcgi] + default: > *none, if parameters omitted, default parameters are interval=30000 fall=5 rise=2 timeout=1000 default_down=true type=tcp* + context: **upstream** + description: Add the health check for the upstream servers. + parameters | Parameter | Description | | -------- | --------------- | | interval | the check request's interval time(ms). | | fall | After fall_count check failures, the server is marked down. | | rise | After rise_count check success, the server is marked up | | timeout | Check request timeout (ms). | | default_down | Initial server state (true = down, false = up). | | type | Check protocol type (see below). | | port | Custom check port (default: same as backend server). | + Supported type values **tcp**: Simple TCP socket connection check. **ssl_hello**: Send SSL ClientHello and receive ServerHello. **http**: Send HTTP request and validate response. **mysql**: Check MySQL server greeting. **ajp**: Send AJP Cping and validate Cpong response. **fastcgi**: Validate FastCGI response. ### check_http_send + Syntax: > check_http_send http_packet + Default: > "GET / HTTP/1.0\r\n\r\n" Context: > upstream Description: > Defines the HTTP request sent for health checks (when type=http). ### check_http_expect_alive + Syntax > check_http_expect_alive [http_2xx | http_3xx | http_4xx | http_5xx] + Default > http_2xx http_3xx + Context: > upstream + Description: > HTTP status codes indicating a healthy server. ### check_keepalive_requests + Syntax: > check_keepalive_requests num + Default: > 1 + Context: > upstream + Description: > Number of requests sent per keepalive connection. ### check_fastcgi_param + Syntax: > check_fastcgi_params parameter value + Default ```nginx check_fastcgi_param "REQUEST_METHOD" "GET"; check_fastcgi_param "REQUEST_URI" "/"; check_fastcgi_param "SCRIPT_FILENAME" "index.php"; ``` + Context > upstream + Description > FastCGI headers sent for health checks (when type=fastcgi). ### check_shm_size + Syntax: > check_shm_size size + Default: > 1M + Context: > http + Description: > Shared memory size for storing health check data. ### check_status + Syntax: > check_status [html | csv | json] + Default: > html + Context: > location + Description: Displays upstream server status. Use URL parameters to customize output + URL parameters: + ?format=html|csv|json + ?status=up|down Below it's the sample html page: ```http://IP:PORT/status?format=html``` ```html