server { listen 80; server_name wp.zzygx.ml; if ($http_user_agent ~* (baiduspider|360spider|haosouspider|googlebot|soso|bing|sogou|yahoo|sohu-search|yodao|YoudaoBot|robozilla|msnbot|MJ12bot|NHN|Twiceler)) { return 403; } location / { sub_filter cn.wordpress.org wp.zzygx.ml; sub_filter_once off; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Referer http://cn.wordpress.org; proxy_set_header Host cn.wordpress.org; proxy_pass http://cn.wordpress.org; proxy_set_header Accept-Encoding ""; } }