未果

#——————————————————– #- _ __ ___ ____ WikiMirror-Public - #- / \ _ _\ \ / (_) / ___ ___ _ ____ _____ _ __ - #- / _ \ ‘_ \ V / \___ \ / _ \ ‘__\ \ / / _ \ ‘__- #- / ___ \ ___) __/ \ V / __/ - #-/_/ \_\_ __ _ ____/ \____ \_/ \____ - #——————————————————– #镜像站会将源站中发送的".wikipedia.org"字符串全部替换为".example.com", #镜像站为了支持全部(将近三百个)语言分站与它们所包含的不计其数的页面与资源,不得不这么做。 #详见:https://zhwp.org/Topic:Veamsg4xywbgb6xa #——————————————————– server { listen 80; listen [::]:80; listen 443 ssl http2; listen [::]:443 ssl http2; server_name ~^(?[^.]+(\.m)?\.)?example\.com$; add_header AnYi-Mirror-Site-public “Config modified at 2020-02-12”;

#阻止搜索引擎蜘蛛收录站点。
if ($http\_user\_agent ~\* "BotSpiderBingPreviewFeedfetcher-Googleia\_archiverMBCrawlerMediapartners-GoogleMSNot-mediaTeomaYahoo! Slurp^$") {
    return 444;
}

location / {
    resolver             8.8.8.8 ipv6=on;
    proxy\_pass           https://${subdomain}wikipedia.org;
    proxy\_cookie\_domain  wikipedia.org example.com;
    proxy\_redirect       https://www.wikipedia.org/ https://www.example.com/;
    proxy\_redirect       https://${subdomain}wikipedia.org/ https://${subdomain}example.com/;
    proxy\_redirect       https://${subdomain}m.wikipedia.org/ https://${subdomain}m.example.com/;
    proxy\_set\_header     Accept-Encoding "";
    proxy\_set\_header     Host ${subdomain}wikipedia.org;
    proxy\_set\_header     Referer $http\_referer;
    proxy\_set\_header     User-Agent $http\_user\_agent;
    proxy\_set\_header     X-Forwarded-For $proxy\_add\_x\_forwarded\_for;
    proxy\_set\_header     X-Forwarded-Proto https;
    proxy\_set\_header     X-Real-IP $remote\_addr;
    sub\_filter           ".wikipedia.org" ".example.com";
    sub\_filter\_once      off;
    sub\_filter\_types     \*;
}

}


Last modified on 2020-03-13