Commit 746f0a01 by Joneq

答应header变量

parent 642413a5
Showing with 7 additions and 5 deletions
...@@ -21,11 +21,7 @@ local cjson = require "cjson" ...@@ -21,11 +21,7 @@ local cjson = require "cjson"
local headers = ngx.req.get_headers()
for k, v in pairs(headers) do
print(k .. ":" .. v)
end
ngx.exit(ngx.HTTP_FORBIDDEN)
-------去除一些不要验证的请求并获取url -------去除一些不要验证的请求并获取url
...@@ -43,6 +39,12 @@ red:set_timeout(1000) ...@@ -43,6 +39,12 @@ red:set_timeout(1000)
local ok, err = red:connect(config.redis_host, config.redis_port) local ok, err = red:connect(config.redis_host, config.redis_port)
local headers = ngx.req.get_headers()
for k, v in pairs(headers) do
ngx.say(k .. ":" .. v,err)
end
ngx.exit(ngx.HTTP_FORBIDDEN)
-- 如果连接失败,跳转到label处 -- 如果连接失败,跳转到label处
if not ok then if not ok then
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment