时间:2016-02-26 18:24 来源: 我爱IT技术网 作者:佚名
欢迎您访问我爱IT技术网,今天小编为你分享的电脑教程是服务器系列之:【Nginx中IF、AND、OR语句用法实例】,下面是详细的分享!
Nginx中IF、AND、OR语句用法实例
location=/test_and/ {
default_type text/html;
set $a 0;
set $b 0;
if ( $remote_addr !='' ){
set $a 1;
}
if ( $http_x_forwarded_for !='' ){
set $a 1$a;
}
if ( $a=11 ){
set $b 1;
}
echo $b;
}
location=/test_or/ {
default_type text/html;
set $a 0;
set $b 0;
if ( $remote_addr !='' ){
set $a 1;
}
if ( $http_x_forwarded_for !='' ){
set $a 1;
}
if ( $a=1 ){
set $b 1;
}
echo $b;
}
以上就是关于Nginx中IF、AND、OR语句用法实例的服务器维护教程分享,更多电脑教程请移步到>>电脑教程频道。
- 评论列表(网友评论仅供网友表达个人看法,并不表明本站同意其观点或证实其描述)
-
