未果





2020-03-13 19:26:30
#-------------------------------------------------------- # # # # #-/\_/ \\\_\\\_ \_\_ \_ \_\_\_\_/ \\\_\_\_\_ \\\_/ \\\_\_\_\_ - #-------------------------------------------------------- #镜像站会将源站中发送的".wikipedia.org"字符串全部替换为".example.com", #镜像站为了支持全部(将近三百个)语言分站与它们所包含的不计其数的页面与资源,不得不这么做。 #详见:https://zhwp.org/Topic:Veamsg4xywbgb6xa #-------------------------------------------------------- server { listen 80; listen \::\?\\.)?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 \*; } }