sam
(Sam Saffron)
February 18, 2019, 3:03am
29
SystemZ:
To prevent this issue in the future, just turn off “external system avatars enabled” in Discourse settings.
This fixed issue for me even without restarting.
konklone:
Turning off the CDN option altogether means avatars themselves are pulled down from their self-hosted URLs and not proxied to the CDN host at all, which is another way of resolving the problem (at some potential performance cost).
Per:
committed 09:46PM - 17 Feb 19 UTC
Co-authored-by: Sam Saffron <sam.saffron@gmail.com>
Co-authored-by: David Taylor… <david@taylorhq.com>
This gives more control over the request. In particular we can easily
lookup DNS dynamically, instead of only upon NGINX startup.
Previously, NGINX was looking up IP for the letter avatar service and
caching the CDN IP address, this caused issues if CDN changed IP, in
which letter avatars would be broken till a container restarted.
NGINX config has been updated to add caching. This change will require
a container rebuild.
The proxy will now function in development environments, so the patch
for `letter_avatar_proxy` has been removed.
The root cause is sorted, we can move our CDN as much as we want and letter avatars will continue to work.
Originally there was a proposal to modify our NGINX config here to amend the resolver by @Matt_Campbell Configure the nginx resolver to eliminate name resolution on startup by mwcampbell · Pull Request #413 · discourse/discourse_docker · GitHub however I was worried a lot about amendments to NGINX.
New design uses Ruby to do the proxying of the images (which are super aggressively cached) so the actual functionality is unchanged except that NGINX no longer does the caching so IP caching of CDN is gone.
17 Likes