Tengine实现健康检查
编辑配置文件
user root;
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 80;
server_name localhost;
location / {
root html;
index index.html index.htm;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
# =============BEGIN 健康检查 =============
# 配置负载均衡要使用 upstream
upstream myServers-hc{
server 192.168.1.20:9090
server 192.168.1.20:9091
# 加入健康检查
check interval=3000 rise=2 fall=5 timeout=1000 type=http;
check_keepalive_requests 100;
check_http_send "