I tried both access_by_lua directive and rewrite_by_lua and on the logs I can see the filters are working as expected example log lines, but still I see a 304 on the client side.
*1 [lua] clear_header.lua:1: Inside Lua error: Success[0]
*1 [lua] clear_header.lua:5: Inside match error: Success[0]
*1 [lua] clear_header.lua:6: Tue, 14 Apr 2015 03:33:44 GMT error: Success[0]
*1 [lua] clear_header.lua:7: "cd98cadaf838b6d3a33d5d58cffcbb6f" error: Success[0]
*1 [lua] clear_header.lua:12: nil error: Success[0]
*1 [lua] clear_header.lua:13: nil error: Success[0]
Lua with logging, sample location block,
location /my-home/{
access_by_lua '
ngx.log(ngx.ERR, "Inside Lua")
if ngx.var.args ~= nil then
match,err = ngx.re.match(ngx.var.args, "query_args")
if match then
ngx.log(ngx.ERR, "Inside match")
ngx.log(ngx.ERR, ngx.req.get_headers()["If-Modified-Since"])
ngx.log(ngx.ERR, ngx.req.get_headers()["If-None-Match"])
ngx.req.clear_header("If-Modified-Since")
ngx.req.clear_header("If-None-Match")
ngx.log(ngx.ERR, ngx.req.get_headers()["If-Modified-Since"])
ngx.log(ngx.ERR, ngx.req.get_headers()["If-None-Match"])
end
end
';
}
On Thursday, May 7, 2015 at 8:06:18 AM UTC-7, David Santhosh wrote:
This is not really an issue but a question,
I am trying to disable object revalidation at my caching layer based on query args, tried the following code
if ngx.var.args ~= nil then
match,err = ngx.re.match(ngx.var.args, "myqueryarg")
if match then
ngx.req.clear_header("If-Modified-Since")
ngx.req.clear_header("If-None-Match")
end
end
Though the headers are set to nil, I still see the server responding 304. Any help is appreciated.