方案方法:

location ~* ^/(?![e|u]) { .. 伪静态规则 } //通过 location ~* ^/(?![e|u])  来设置排除目录,| 分割多个目录。

location ~* ^/(?![e|u]) {

... 伪静态规则

}

举例:

location ~* ^/(?![e|u]) {
  rewrite ^/$ http://www.copycf.com/ permanent;
  rewrite ^/(.*)/$ http://www.copycf.com/$1/ permanent;
  rewrite ^/(.*)/(.*)/$ http://www.copycf.com/$1/s2/ permanent;
  rewrite ^/(.*)/([0-9]+)\.html$ http://www.copycf.com/$1/$2.html permanent;
  rewrite ^/(.*)/(.*)/([0-9]+)\.html$ http://www.copycf.com/$1/s2/$3.html permanent;
}

注:以上是排除e,u目录301跳转.如果是访问E目录下的文件不做跳转,反知其他目录直接跳转