Welcome! Log In Create A New Profile

Advanced

Request denying in a specific time range

Posted by David999 
Request denying in a specific time range
May 14, 2017 04:22PM
Hi,

I need to block requests that are made in a specific time range as long as it's not an exclusion like in the pseudo code below.

I know that perl module is not allowed to be called inside "if" block and there is no possibility to pass arguments to perl block from location or vice versa.

Any help would be appreciated..

location {
..
if (true){
set $block_request 1
}

perl req_time_control::handler $block_request;

}

R.
Re: Request denying in a specific time range
May 16, 2017 06:21AM
It took a long time to reach the info below.. I think it could have documented better in official page of the module..


#nginx.conf

set $variable_name "xxxx";

#perl
my $value = $r->variable('variable_name');
Sorry, only registered users may post in this forum.

Click here to login

Online Users

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