# 即使设置了 DISCOURSE\_S3\_CDN\_URL，来自 S3 的下载仍然会出现

**URL:** <https://meta.discourse.org/t/downloads-coming-from-s3-even-with-discourse-s3-cdn-url-set/177000>\
**Category:** Product Support\
**Created:** [2021 年1 月 23 日 01:13 UTC](https://meta.discourse.org/t/downloads-coming-from-s3-even-with-discourse-s3-cdn-url-set/177000 "2021-01-23T01:13:14Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

作者： ![foozmeat](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/foozmeat/32/107214_2.png) [@foozmeat](https://meta.discourse.org/u/foozmeat)\
发布日期： [2021 年1 月 23 日 01:13 UTC](https://meta.discourse.org/t/downloads-coming-from-s3-even-with-discourse-s3-cdn-url-set/177000/1 "2021-01-23T01:13:14Z")

</div>

我按照 [Configure an S3 compatible object storage provider for uploads](https://meta.discourse.org/t/using-object-storage-for-uploads-s3-clones/148916) 上的指南配置了 Backblaze B2 作为上传存储，但遇到了一个奇怪的问题。

如果我创建一个话题并上传图片，img 的 src 会被设置为我的 S3\_CDN\_URL。但如果我上传一个 zip 文件，URL 会指向 `/uploads` 并直接重定向到我的存储桶，而不是使用 S3\_CDN\_URL。我没有设置 `DISCOURSE_CDN_URL` —— 指南指出这不会影响此问题。

我相关的设置如下：

```plaintext
  DISCOURSE_USE_S3: true
  DISCOURSE_S3_REGION: "us-west-000"
  DISCOURSE_S3_INSTALL_CORS_RULE: false
  DISCOURSE_S3_CONFIGURE_TOMBSTONE_POLICY: false
  DISCOURSE_S3_ENDPOINT: "https://s3.us-west-000.backblazeb2.com"
  DISCOURSE_S3_ACCESS_KEY_ID: "ID"
  DISCOURSE_S3_SECRET_ACCESS_KEY: "KEY"
  DISCOURSE_S3_CDN_URL: "https://devforum-b2-cdn.freetls.fastly.net"
  DISCOURSE_S3_BUCKET: "bucket-name"
  DISCOURSE_S3_BACKUP_BUCKET: "backup-bucket/devforum"
  DISCOURSE_BACKUP_LOCATION: s3

```

为什么 zip 文件的处理方式会与图片不同？

---

_[View the full topic](https://meta.discourse.org/t/downloads-coming-from-s3-even-with-discourse-s3-cdn-url-set/177000)._
