Welcome! Log In Create A New Profile

Advanced

nginx http poller module

Dave Bailey
April 30, 2013 12:46PM
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
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

nginx http poller module

Dave Bailey April 30, 2013 12:46PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 229
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready