title: nginx lua-resty-http no route to host error
body: <p>I'm trying to make an http request using lua-resty-http.
  I created a simple get api in <a href="https://requestb.in" rel="nofollow noreferrer">https://requestb.in</a></p>
  
  <p>I can make a request using the address: <a href="https://requestb.in/snf2ltsn" rel="nofollow noreferrer">https://requestb.in/snf2ltsn</a></p>
  
  <p>However, when I try to do this in nginx I'm getting error  <code>no route to host</code></p>
  
  <p>My nginx.conf file is:</p>
  
  <pre><code>worker_processes  1;
  error_log logs/error.log;
  events {
      worker_connections 1024;
  }
  http {
      lua_package_path "$prefix/lua/?.lua;;";
      server {
          listen 8080;
          location / {
              resolver 8.8.8.8;
              default_type text/html;
              lua_code_cache off; #enables livereload for development
              content_by_lua_file ./lua/test.lua;
          }
      }
  }
  </code></pre>
  
  <p>and my Lua code is </p>
  
  <pre><code>local http = require "resty.http"
  local httpc = http.new()
  
  --local res, err = httpc:request_uri("https://requestb.in/snf2ltsn", {ssl_verify = false,method = "GET" })
  
        local res, err = httpc:request_uri("https://requestb.in/snf2ltsn", {
          method = "GET",
          headers = {
            ["Content-Type"] = "application/x-www-form-urlencoded",
          }
        })
  </code></pre>
  
  <p>How can I fix this Issue?
  Or is there any suggestion to make http request in nginx?
  any clue?</p>
  
  <p>PS: There is a commented section in my Lua code. I also tried to make a request using that code but nothing happened.</p>