2018-07-03 11:20:51 536浏览
一、NginxRewrite规则相关指令有if、rewrite、set、return、break等rewrite^/b/(.*)\.html/play.php?video=$1last; break;
if(!-f$request_filename) rewrite^/img/(.*)$/site/$host/images/$1last;
RewriteRule^/(mianshi|xianjing)/$/zl/index.php?name=$1[L] RewriteRule^/ceshi/$/zl/ceshi.php[L] RewriteRule^/(mianshi)_([a-zA-Z]+)/$/zl/index.php?name=$1_$2[L] RewriteRule^/pingce([0-9]*)/$/zl/pingce.php?id=$1[L]
rewrite^/(mianshi|xianjing)/$/zl/index.php?name=$1last; rewrite^/ceshi/$/zl/ceshi.phplast; rewrite^/(mianshi)_([a-zA-Z]+)/$/zl/index.php?name=$1_$2last; rewrite^/pingce([0-9]*)/$/zl/pingce.php?id=$1last;
if($remote_addr~"^(12.34|56.78)"&&$http_user_agent~*"spider"){ return403; }
set$flag0; if($remote_addr~"^(12.34|56.78)"){ set$flag"${flag}1"; } if($http_user_agent~*"spider"){ set$flag"${flag}2"; } if($flag="012"){ return403; }
location/{ if($request_filename~^(.+)/(.+)$){ set$l2$1; } set$ll$request_filename; if(!-e$request_filename){ set$l3"3"; } if(!-e$l2){ set$l4"1$l3"; } if($l4=13){ rewrite^(.*)$https://www.codingke.com; } access_log/tmp/pythotab-access.logxingcheng; error_log/tmp/pythotab-error.log; }
以上就是关于扣丁学堂红帽Linux开发Nginx实现IF语句AND和OR多重判断的详细介绍,想要了解更多关于Linux培训就业班或行业前景,请关注扣丁学堂官网、微信等平台,扣丁学堂IT职业在线学习教育平台为您提供权威的Linux视频教程系统,通过千锋扣丁学堂金牌讲师在线录制的Linux视频教程课程,让你快速掌握Linux从入门到精通开发实战技能。扣丁学堂Linux技术交流群:422345477
【关注微信公众号获取更多的学习资料】