需要帮助吗?我有这个
service {
name = "nginx"
tags = [ "nginx", "web", "urlprefix-/nginx" ]
port = "http"
check {
type = "tcp"
interval = "10s"
timeout = "2s"
}
}如果特定URI返回类似于localhost:8080/test/index.html的200响应,我如何为其添加健康
发布于 2019-11-07 14:03:55
这就像添加另一个配置为使用http检查的检查一样简单,如下所示,其中/health由您的nginx在其发布的端口上提供服务:
service {
name = "nginx"
tags = [ "nginx", "web", "urlprefix-/nginx" ]
port = "http"
check {
type = "tcp"
interval = "10s"
timeout = "2s"
}
check {
type = "http"
path = "/health"
interval = "10s"
timeout = "2s"
}
}你可以在这里看到完整的例子:https://www.nomadproject.io/docs/job-specification/index.html
https://stackoverflow.com/questions/56698092
复制相似问题