小智 5
它就像添加另一个检查一样简单,配置为使用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"
}
}
Run Code Online (Sandbox Code Playgroud)
您可以在此处查看完整示例:https : //www.nomadproject.io/docs/job-specification/index.html