run an action every 30 seconds

kindy kindy61 at gmail.com
Tue Feb 8 15:02:57 MSK 2011


    server {
        listen       8082;
        server_name  localhost;

        location = /a-help2 {
            content_by_lua 'ngx.say(ngx.time())';
        }
        location = /a-help {
            proxy_pass http://127.0.0.1:8082/a-help2;
        }
        location = /a {
            echo_location /a-help;
            echo_sleep 2;
            echo_location /a-help;
        }
    }

start a cron job to curl localhost:8082/a
just a sample conf.

require nginx-echo module( https://github.com/agentzh/echo-nginx-module )


On Tue, Feb 8, 2011 at 7:35 PM, michalkraus <nginx-forum at nginx.us> wrote:
> Thanks for your options
>
>> 3) Use a heartbeat solution - http://linux-ha.org/wiki/Main_Page
>
> I have API between the Nginx and the second (control) server. I use RPC
> interface. I need just send a RPC request (with status infrmation) to
> the control server. I think that heartbeat is too robust.
>
>> 4) Use cron to start a script which does the test, sleeps for 30s,
> then does
>> the test again, then dies (to be restarted by cron
>> at the next minute)
>
> This option seems to be the best but is any possibility the nginx to do
> it in its own?
>
> Posted at Nginx Forum: http://forum.nginx.org/read.php?2,173142,173166#msg-173166
>
>
> _______________________________________________
> nginx mailing list
> nginx at nginx.org
> http://nginx.org/mailman/listinfo/nginx
>



-- 
Regards,

林青(Kindy Lin)



More information about the nginx mailing list