网上提供的js反代站不太稳定的话可以考虑自建
#PROXY-START/
location ~* \.(gif|png|jpg|css|js|woff|woff2)$
{
proxy_pass https://cdn.jsdelivr.net;
proxy_set_header Host cdn.jsdelivr.net;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header REMOTE-HOST $remote_addr;
proxy_ssl_name cdn.jsdelivr.net;
proxy_ssl_server_name on;
expires 12h;
}
location /
{
proxy_pass https://cdn.jsdelivr.net;
proxy_set_header Host cdn.jsdelivr.net;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header REMOTE-HOST $remote_addr;
proxy_ssl_name cdn.jsdelivr.net;
proxy_ssl_server_name on;
add_header X-Cache $upstream_cache_status;
#Set Nginx Cache
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 1200m;
}
#PROXY-END/
One comment
之前hexo博客用了别人的反代 现在typecho直接本地化了