mirror of https://github.com/midoks/mdserver-web
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
447 B
18 lines
447 B
local hc = require "resty.upstream.healthcheck"
|
|
local ok, err = hc.spawn_checker {
|
|
shm = "healthcheck",
|
|
type = "http",
|
|
upstream = "{$UPSTREAM_NAME}",
|
|
http_req = "GET / HTTP/1.0\r\nHost: {$UPSTREAM_NAME}\r\n\r\n",
|
|
interval = 2000,
|
|
timeout = 6000,
|
|
fall = 3,
|
|
rise = 2,
|
|
valid_statuses = {200, 302},
|
|
concurrency = 20,
|
|
}
|
|
|
|
if not ok then
|
|
ngx.log(ngx.ERR, "=======> load balance health checker error: ", err)
|
|
return
|
|
end |