# 头像是如何存储和访问的？

**URL:** https://meta.discourse.org/t/how-are-avatars-stored-and-accessed/53065
**Category:** Support
**Created:** [2016年十一月18日 06:55 UTC](https://meta.discourse.org/t/how-are-avatars-stored-and-accessed/53065 "2016-11-18T06:55:19Z")
**Posts on this page:** 1
**Showing post:** 1

<div class="post-metadata">

### Author: ![DanielMarquard](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/danielmarquard/32/74010_2.png) [@DanielMarquard](https://meta.discourse.org/u/DanielMarquard)
#### Post date: [2016年十一月18日 06:55 UTC](https://meta.discourse.org/t/how-are-avatars-stored-and-accessed/53065/1 "2016-11-18T06:55:19Z")

</div>

TL;DR: I’m having trouble understanding how avatars are accessed on S3.

I’m in the process of moving my Discourse over to AWS, where all the rest of my websites are. I’m a huge proponent of CloudFront, not just as a traditional CDN, but as a Varnish-like front-end with multiple origins. I like to route all of my traffic through CloudFront, where requests are then sent to S3 buckets or web servers based on a number of rules.

I’m doing this for the first time with Discourse, and S3 uploads are facilitating this. Unfortunately, I’m having a tough time understanding how avatars are accessed. They appear to be uploaded to the S3 bucket in the same manner as post uploads, but not in the `user_avatar` directory as they’re referenced in the image path. With S3 uploads enabled, newly-uploaded avatars appear to be missing locally and remotely. Are avatar image paths actually URL rewrites to images under the `uploads` directory? Or am I missing something?

---

_[View the full topic](https://meta.discourse.org/t/how-are-avatars-stored-and-accessed/53065)._
