摘要:
如题,apache的rewrite是支持或者的,用个OR就可以,如果不加OR,多个RewriteCond 罗列累加就是并且的意思。然后nginx的rewrite就没有这么好了。那么如何去实现这样复杂的功能呢?这就用到了标记功能。现在出一个简单的需求: 要求访问uri以 /abc/开头的请求,并且us... 阅读全文
摘要:
转自:http://blog.sina.com.cn/s/blog_5d73ba76010145rr.html首先看一个完整代码示例,关于nginx 301 302跳转的。301跳转设置:server {listen 80;server_name 123.com;rewrite ^/(.*) htt... 阅读全文
摘要:
$document_uri表示访问的url现在我的需求是,访问 www.abc.com请求到 www.abc.com/abc/在nginx配置文件中加入 if ($document_uri !~ 'abc') { rewrite ^/(.*)$ http://www.ab... 阅读全文