Replace old link
$url = $isSecure ? ' https://secure.gravatar.com ' : ' http://www.gravatar.com '; $url .= '/ avatar/';
$url = $isSecure ? ' https://sdn.geekzu.org/avatar/ ' : ' https://cdn.v2ex.com/gravatar/ ';
//$url .= '/ avatar/';
/**Custom avatar source*/ define('__TYPECHO_GRAVATAR_PREFIX__', ' https://cdn.v2ex.com/gravatar/ ');
Take the place of yourself
proxy_cache_path /home/wwwcache/gravatar levels=1:2 keys_zone=gravatar:5m inactive=30m max_size=50m;
location /avatar/ { proxy_pass https://secure.gravatar.com/avatar/ ; proxy_redirect off; proxy_set_header Host secure.gravatar.com; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto https; proxy_set_header Accept-Encoding ""; proxy_cache gravatar; proxy_cache_key $scheme$host$request_uri; proxy_cache_valid 200 304 3h; proxy_cache_valid 301 24h; proxy_cache_valid 500 502 503 504 0s; proxy_cache_valid any 3h; }
proxy_cache_path /home/wwwcache/gravatar levels=1:2 keys_zone=gravatar:5m inactive=30m max_size=50m; server { listen 80; server_name himiku.com ; return 301 https://himiku.com $request_uri; } server { listen 443 ssl http2; server_name himiku.com; index index.html; ssl........ ellipsis location /avatar/ { proxy_pass https://secure.gravatar.com/avatar/ ; proxy_redirect off; proxy_set_header Host secure.gravatar.com; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto https; proxy_set_header Accept-Encoding ""; proxy_cache gravatar; proxy_cache_key $scheme$host$request_uri; proxy_cache_valid 200 304 3h; proxy_cache_valid 301 24h; proxy_cache_valid 500 502 503 504 0s; proxy_cache_valid any 3h; } ...... Other Omissions }
Author: mikusa
Link to this article: https://www.himiku.com/archives/gravatar.html
Copyright notice: Unless otherwise stated, all articles are my own creation. Please contact the author for reprinting and quotation, and indicate the source (author, original link, etc.).