# 获取本地时间
if ( $time_local ~ “^(\d+)\/(\w+)\/(\d+):(\d+):(\d+):(\d+) \+(\d+)” ) {
set $hour $4;
}
# 指定时间黑名单,如果为指定时间,返回403
if ( $hour ~ 00|01|05|06|07 ) {
return 403;
}
# 获取本地时间
if ( $time_local ~ “^(\d+)\/(\w+)\/(\d+):(\d+):(\d+):(\d+) \+(\d+)” ) {
set $hour $4;
}
# 指定时间黑名单,如果为指定时间,返回403
if ( $hour ~ 00|01|05|06|07 ) {
return 403;
}