Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

invalid http_req introduce 400 code #65

Open
shsun opened this issue Nov 28, 2019 · 0 comments
Open

invalid http_req introduce 400 code #65

shsun opened this issue Nov 28, 2019 · 0 comments

Comments

@shsun
Copy link

shsun commented Nov 28, 2019

I introduce this module to my project but got 400 error for the invalid http_req.

    local ok, err = hc.spawn_checker{
        shm = "healthcheck",  -- defined by "lua_shared_dict"
        upstream = "foo.com", -- defined by "upstream"
        type = "http",

        -- the http_req has a bug ? 
        -- http_req字段的格式可能有问题? 至少在我这里是老得到400 code. 
        http_req = "GET /status HTTP/1.0\r\nHost: foo.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},  -- a list valid HTTP status code
        concurrency = 10,  -- concurrency level for test requests
    }

Everything is ok if i update the http_req as below:
http_req = "GET /status HTTP/1.0\r\n\r\nHost: foo.com",

please advice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant