需要帮助,我有这个
service {
name = "nginx"
tags = [ "nginx", "web", "urlprefix-/nginx" ]
port = "http"
check {
type = "tcp"
interval = "10s"
timeout = "2s"
}
}
如果返回200响应,如何为特定URI添加运行状况 像localhost:8080 / test / index.html
答案 0 :(得分:2)
就像添加另一个配置为使用http
支票的支票一样简单,这样您的nginx在其发布的端口上为/health
提供服务:
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