tengine版本2.1.2.其中172.16.2.112为nginx服务器,172.16.2.110为tomcat服务器。 在不添加health check的时候,curl对应的chk.html可以正常返回页面。 添加health check之后,tengine的error log报check protocol http error with peer: 172.16.2.110:8080。
配置如下: upstream tomcat-1 { server 172.16.2.110:8080; check interval=3000 rise=2 fall=5 timeout=3000 type=http; check_http_send "GET /chk.html HTTP/1.1\r\n\r\n"; check_http_expect_alive http_2xx http_3xx; } server { listen 80; server_name 172.16.2.112; location / { index index.html; proxy_pass http://tomcat-1/testdb/; proxy_set_header Host $host:80; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header Via "nginx"; break; } location /status { check_status;
access_log off;}
location /nginx_status {
stub_status on;
access_log off;
}
}
报错如下: 2017/11/17 20:17:35 [error] 2451#0: check protocol http error with peer: 172.16.2.110:8080 2017/11/17 20:17:38 [error] 2451#0: check protocol http error with peer: 172.16.2.110:8080 2017/11/17 20:17:41 [error] 2451#0: check protocol http error with peer: 172.16.2.110:8080 2017/11/17 20:17:44 [error] 2451#0: check protocol http error with peer: 172.16.2.110:8080 2017/11/17 20:17:47 [error] 2451#0: check protocol http error with peer: 172.16.2.110:8080
谢谢支持。