Welcome! Log In Create A New Profile

Advanced

Support for local time range checks

Posted by ktwalrus 
Support for local time range checks
May 06, 2012 07:10PM
I'd like to be able to test if the server time is between two times (like between 4am and 4:30am) to automatically serve up a maintenance page without sending the request to a backend server. I'd also like to be able to specify time ranges for different upstream servers such that nginx would gracefully switch to a different set during the specified times. This could be used to DOWN some of the day time servers or to perform maintenance on the day time servers while using some backup servers to handle the night time traffic.

I realize I can just reload the conf file from a cron job with a new configuration, but this seems like it might be more error prone (if one of the reloads fails).

If you don't like testing time ranges to select different servers/maintenance pages, then maybe it would make sense to have a timed config reload specified within the config file:

switch config daily 4am config_path;

or

switch config saturday 1am config_path;



Edited 1 time(s). Last edit at 05/06/2012 07:16PM by ktwalrus.
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 257
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