Hi, I'm new to openresty and i'm trying to setup some healthchecks to check our app running on tomcat. What I would like to happen is have the healthchecker check the tomcat manager for something like:
However, I cannot get to the tomcat manger because it requires basic auth. Is there a way to pass basic auth through the healthchecker?
upstream admin {
server 10.2.0.2:13200;
server 10.2.0.3:13200;
server 10.2.0.4:13200;
}
lua_shared_dict healthcheck 1m;
lua_socket_log_errors off;
init_worker_by_lua_block {
local hc = require "resty.upstream.healthcheck"
local ok, err = hc.spawn_checker{
shm = "healthcheck", -- defined by "lua_shared_dict"
upstream = "imging-admin", -- defined by "upstream"
type = "http",
http_req = "GET /manager/text/list HTTP/1.1\r\nHost: admin\r\n\r\n",
-- raw HTTP request for checking
interval = 2000, -- run the check cycle every 2 sec
timeout = 3000, -- 1 sec is the timeout for network operations
fall = 3, -- # of successive failures before turning a peer down
rise = 2, -- # of successive successes before turning a peer up
valid_statuses = {200, 302}, -- a list valid HTTP status code
concurrency = 10, -- concurrency level for test requests
Any help is appreciated.