Show all posts by user
Introduce yourselves
Page 1 of 1 Pages: 1
Results 1 - 2 of 2
Downloading seems to take forever. The contents of my key_lookup.lua is below:
local cjson = require("cjson")
local headers = ngx.req.get_headers()
local key = headers["X-KEY-HEADER"]
if key then
local value = ngx.shared.lookuptable
if value then
ngx.req.set_header("X-VALUE-HEADER", tostring(value))
else
ngx.log(ngx.ERR, "Unabl
by
tripledot
-
How to...
I have a rewrite_by_lua_file directive where I lookup a key supplied as a header in the original request, in a shared lookup table. If found, I pass as a header the value mapped to the original key. If not, I return a specific status code.
So in my nginx.conf file I have something like this:
location /start
{
rewrite_by_lua_file key_lookup.lua;
proxy_pass http://127.0.0.1:8080/s
by
tripledot
-
How to...