Issuing an http request to distant server from a timer handler

MAGNIEN, Thierry thierry.magnien at
Tue Sep 11 09:21:26 UTC 2012


I'm writing a module that needs to periodically request a distant HTTP server. I've setup an event handler through ngx_add_timer so that the handler is called every N seconds.

Is there a simple way to make this HTTP request from the handler ? I've looked at ngx_http_named_location but this needs a request as argument and I don't have such in my event handler.

Can I just create/allocate a new request and pass it to ngx_http_named_location ?

Thanks for your help,

More information about the nginx-devel mailing list