openresty / lua-resty-upstream-healthcheck

Health Checker for Nginx Upstream Servers in Pure Lua
515 stars 134 forks source link

one domain return 502 #74

Closed lemon9921010 closed 4 years ago

lemon9921010 commented 4 years ago

Many upstream works, but this domain return 502 How can I debug? conf like this local ok, err = hc.spawn_checker{ shm = 'healthcheck', -- defined by 'lua_shared_dict' upstream = 'test', -- defined by 'upstream' type = 'http',

        http_req = 'GET /status HTTP/1.0\r\nHost: healthcheck.nxin.com\r\n\r\n',
                -- raw HTTP request for checking

        interval = 2000,  -- run the check cycle every 2 sec
        timeout = 1000,   -- 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, 301,401,402,403, 404},  -- a list valid HTTP status code
        concurrency = 10,  -- concurrency level for test requests
    }

request respones below

curl 10.21.1.11:8080/status -v

lemon9921010 commented 4 years ago

app need agent, conf like below. closed http_req = 'GET /status HTTP/1.0\r\nUser-Agent: LuaSocket 3.0-rc1\r\n\r\n'