Module development question regarding ngx_http_get_module_loc_conf

Aaron Bedra aaron.bedra at
Wed Jul 11 22:18:52 UTC 2012

On Jul 11, 2012, at 4:45 PM, Valentin V. Bartenev wrote:

> On Thursday 12 July 2012 01:00:11 Aaron Bedra wrote:
>> Oh wow, I didn't realize that. I just tried another phase
>> (NGX_HTTP_PREACCESS_PHASE) and the configuration showed up as expected.
>> Thanks so much for pointing this out! The only other question is what phase
>> to put this in. When I use preaccess the header shows up twice.
> It is because your module does not properly handle internal redirects (and
> subrequests btw).
> As an example, see the first lines of ngx_http_limit_req_handler() or 
> ngx_http_limit_conn_handler().


> Btw, if the purpose of your module is to add header, then it's better to develop
> a header filter.

I was unsure of that when I was reading things. I'll investigate this option as well.

> Also note, that is_abuser() blocks nginx process.

Yeah, I figured. I need to find a better way to do that. That's my plan after the module is working properly otherwise.  Thanks again for your help!



More information about the nginx-devel mailing list