# 这里是屏蔽恶意蜘蛛的规则 if ( $http_user_agent ~ AhrefsBot ){ return 403; } if ( $http_user_agent ~ YandexBot ){ return 403; } if ( $http_user_agent ~ MJ12bot ){ return 403; } if ( $http_user_agent ~ RU_Bot ){ return 403; } if ( $http_user_agent ~ Ezooms ){ return 403; } if ( $http_user_agent ~ Yeti ){ return 403; } if ( $http_user_agent ~ BLEXBot ){ return 403; } if ( $http_user_agent ~ Exabot ){ return 403; } if ( $http_user_agent ~ YisouSpider ){ return 403; } if ( $http_user_agent ~ sandcrawlerbot ){ return 403; } if ( $http_user_agent ~ ShopWiki ){ return 403; } if ( $http_user_agent ~ Genieo ){ return 403; } if ( $http_user_agent ~ Aboundex ){ return 403; } if ( $http_user_agent ~ coccoc ){ return 403; } # 这里是301重定向规则 if ($host = 'wordpress2.vnow.info' ) { rewrite ^/(.*)$ http://wordpress.vnow.info/$1 permanent; } # 这里是wordpress的伪静态规则 location / { if (-d $request_filename) { break; } if (-f $request_filename) { break; } try_files $uri /$uri /index.php$is_args$args; }