nginx_upstream_check_module icon indicating copy to clipboard operation
nginx_upstream_check_module copied to clipboard

fastcgi方式检测后端异常

Open sxauyhz opened this issue 7 years ago • 2 comments
trafficstars

你好,我配置如下方式检测后端PHP的状态,报错:check protocol fastcgi error with peer: 10.10.20.27:9000

check interval=2000 rise=1 fall=3 timeout=1000 type=fastcgi;
check_fastcgi_param "REQUEST_METHOD" "GET";
check_fastcgi_param "DOCUMENT_ROOT" "/home/src/php";
check_fastcgi_param "REQUEST_URI" "/";
check_fastcgi_param "SCRIPT_FILENAME" "phpinfo.php";
# 或者如下,都报错:
# check_fastcgi_param "SCRIPT_FILENAME" "$document_root/phpinfo.php";

但是:当我把改成如下后,可以正常,请问改如何设置document_root的目录? 另还发现这里不支持变量,例如写成$document_root 无法解析,抓包可以看到。

check interval=2000 rise=1 fall=3 timeout=1000 type=fastcgi;
check_fastcgi_param "REQUEST_METHOD" "GET";
check_fastcgi_param "REQUEST_URI" "/";
check_fastcgi_param "SCRIPT_FILENAME" "/home/src/php/phpinfo.php";

sxauyhz avatar Jan 30 '18 07:01 sxauyhz

同问

liukai1991 avatar Jan 30 '18 07:01 liukai1991

请问fastcgi 怎么配置 我访问status error log 显示http upstream check module can not find any check server 我的是upstream xx{ server 127.0.0.1:8088; check interval=3000 rise=2 fall=5 timeout=1000 type=fastcgi default_down=true; check_fastcgi_param "REQUEST_METHOD" "GET"; check_fastcgi_param "REQUEST_URI" "/healthcheck"; }

chaoshendasixiong avatar Jul 19 '18 12:07 chaoshendasixiong