Setting or clearing request->args

leki75 nginx-forum at nginx.us
Tue Sep 22 12:21:51 MSD 2009


Hello,

I try to write a nginx http module which decides to enable or forbid a HTTP request sent in the request parameters (r->args). At the end of decision I would like to clear the whole args or just a part of it, so won't appear in access.log of the origin server.

Is this solution correct without freeing args before?

static ngx_int_t
ngx_http_leki_test_handler(ngx_http_request_t *r)
{
...
    r->args.len  = 0;
    r->args.data = NULL;
    ngx_log_error(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, "OK", 0);
    return NGX_OK;
}

Config example:
...
location / {
    leki_test on;
    http://test;
}
...

Thanks in advance,
    Leki

Posted at Nginx Forum: http://forum.nginx.org/read.php?2,8327,8327#msg-8327






More information about the nginx mailing list