wpmirror-conf/api.wpmirror.com.conf
feibisi 67b95a241a 同步生产 rewrite 规则:18 个配置文件与 admincdn-prod 一致
- 更新: api/cdnjs/googleajax/googlefonts/gstatic/wpstatic 规则与生产同步
- 新增: downloads/ps/s/ts/web.wenpai.net + gh/jsd.admincdn.com + translate/wpmirror.com + wpphoto + litepress.cn
- 删除: 旧命名文件(wordpress-*.conf/gravatar.conf/proxy.conf),统一用生产域名命名
- README: 完整文件清单、域名映射表、使用说明
2026-02-28 15:26:27 +08:00

35 lines
No EOL
1.2 KiB
Text

# WordPress-API
location = /robots.txt {
add_header Content-Type text/plain;
return 200 "User-agent: *\nDisallow: /\n";
}
location ^~ / {
proxy_pass https://api.wordpress.org;
proxy_set_header Host api.wordpress.org;
proxy_set_header Accept-Encoding "";
proxy_ssl_server_name on;
proxy_ssl_protocols TLSv1.2 TLSv1.3;
proxy_http_version 1.1;
resolver 8.8.8.8 ipv6=off valid=120s;
proxy_ignore_headers Set-Cookie Cache-Control expires;
proxy_cache cache_one;
proxy_cache_key $host$uri$is_args$args;
proxy_cache_valid 200 304 301 302 2h;
proxy_cache_valid 404 1d;
proxy_cache_lock on;
proxy_cache_lock_timeout 5s;
proxy_cache_lock_age 5s;
proxy_cache_background_update on;
proxy_cache_use_stale error timeout invalid_header updating http_500 http_502 http_503 http_504;
proxy_cache_revalidate on;
add_header X-Cache $upstream_cache_status;
sub_filter_types *;
sub_filter "downloads.wordpress.org" "downloads.wenpai.net";
sub_filter "api.wordpress.org" "api.wpmirror.com";
sub_filter "ps.w.org" "ps.wenpai.net";
sub_filter "ts.w.org" "ts.wenpai.net";
sub_filter "s.w.org" "s.wenpai.net";
sub_filter_once off;
}