【发布时间】:2022-08-04 11:08:27
【问题描述】:
如何为容器创建健康检查。我有 nginx 作为 openresty 容器运行,我正在尝试创建健康检查。我按照https://sleeplessbeastie.eu/2020/03/09/how-to-use-openresty-to-perform-health-checks/ 的步骤进行操作 但没有运气。 我不断得到: curl http://127.0.0.1:8090/health/http -v
404 未找到如何为容器创建健康检查。我有 nginx 作为 openresty 容器运行,我正在尝试创建健康检查。我按照https://sleeplessbeastie.eu/2020/03/09/how-to-use-openresty-to-perform-health-checks/ 的步骤进行操作 但没有运气。 我不断得到: curl http://127.0.0.1:8090/health/http -v
404 未找到您是否关注整篇文章? 在中间部分,它要求添加此内容。
location /ping {
access_log off;
default_type "text/html";
return 200 "pong\n";
}
location /health/nginx {
default_type "text/html";
content_by_lua_file health/nginx.lua;
}
最初请注意,教程说
local url = "http://127.0.0.1"
但后来,它改为
local url = "http://127.0.0.1/ping"
【讨论】: