<div dir="ltr"><div><div>Hi,<br><br></div>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.<br>
<br>Module source:<br><br><a href="https://github.com/dbcode/nginx-poller-module">https://github.com/dbcode/nginx-poller-module</a><br><br></div>Example configuration (the README has more details):<br><pre><code>http {<br>
poller config {
endpoint <a href="http://config">http://config</a>;
method GET;
header Host config;
header User-Agent nginx;
uri $my_config_uri;
interval $my_config_interval;
}<br>}<br></code></pre>Thanks to Piotr Sikora for ngx_supervisord, which showed how to build the detached request without an incoming connection.<br><div><div><br>-dave<br><br><div><div><br></div></div></div></div></div>