Skip to content
This repository was archived by the owner on Jul 17, 2018. It is now read-only.
This repository was archived by the owner on Jul 17, 2018. It is now read-only.

Unable to call client:request using 127.0.0.1 #1

@nrgyzer

Description

@nrgyzer

Hi,

my code is the following:

local http = require "resty.http"
local client = http:new()
client:set_timeout(3000)

local ok, err = client:connect("127.0.0.1", 9999)

if not ok then
    ngx.say(err)
    return
end

ngx.say("abc");
local res, err = client:request({path = "/requestedFile"})
ngx.say("def");
ngx.flush(true);

nginx writes "abc", but no "def" or similar (for testing purposes). It seems that client:request() throws an error or something similar that forces nginx to cancel the execution. Is there anything special by using 127.0.0.1/localhost? I also tried localhost instead of 127.0.0.1 but I always got "localhost could not be resolved (3: Host not found)".

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions