Proxy letter avatars by default

On sites that don't otherwise configure an avatar fallback, Discourse will
now tell the client to get its letter avatars from a location which nginx
proxies to the centralised `avatars.discourse.org` service.  This alleviates
privacy concerns, whilst still providing some degree of performance benefit
(no need for every site to delay avatar response by 300ms for image
rendering).

It is still possible to gain the benefits of global image caching and the
lower latency of requesting directly from a CDN, by explicitly changing the
`external_system_avatars_url` site setting to
`https://avatars.discourse.org/letter/{first_letter}/{color}/{size}.png`.
This commit is contained in:
Matt Palmer
2015-09-28 21:41:57 +10:00
parent 85daf56ed4
commit c09f345cff
4 changed files with 9 additions and 3 deletions

View File

@@ -192,6 +192,11 @@ server {
break;
}
location /letter_avatar_proxy {
rewrite /letter_avatar_proxy/(.*)$ /$1 break;
proxy_pass https://avatars.discourse.org;
}
# this means every file in public is tried first
try_files $uri @discourse;
}