Setting or clearing request->args

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


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-> = NULL;
    ngx_log_error(NGX_LOG_DEBUG_HTTP, r->connection->log, 0, "OK", 0);
    return NGX_OK;

Config example:
location / {
    leki_test on;

Thanks in advance,

Posted at Nginx Forum:,8327,8327#msg-8327

More information about the nginx mailing list