【问题标题】:Health check for container容器健康检查
【发布时间】: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


    【解决方案1】:

    您是否关注整篇文章? 在中间部分,它要求添加此内容。

    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"
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-04-20
      • 2020-09-19
      • 2019-05-11
      • 2021-02-25
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多