nginx http poller module

Dave Bailey dave at daveb.net
Tue Apr 30 16:45:09 UTC 2013


Hi,

I've written an nginx module that allows the user to configure nginx worker
processes to make detached, repeated "polling" HTTP requests.  The request
endpoint, method, URI, headers, and body are configurable, and it's also
possible to register a set of callbacks to process the response status
line, headers, body, and finalization.  The idea is that if you have a
multiple-worker setup, it may sometimes be useful to have each worker
polling some service with its own status, or to request dynamic
configuration updates, etc.  In some scenarios, this may be a desirable
alternative to using shared memory to synchronize state between workers.

Module source:

https://github.com/dbcode/nginx-poller-module

Example configuration (the README has more details):

http {
  poller config {
    endpoint http://config;
    method   GET;
    header   Host config;
    header   User-Agent nginx;
    uri      $my_config_uri;
    interval $my_config_interval;
  }
}

Thanks to Piotr Sikora for ngx_supervisord, which showed how to build the
detached request without an incoming connection.

-dave
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx/attachments/20130430/3860b76f/attachment-0001.html>


More information about the nginx mailing list