# 非画像アップロードでS3 CDN URLが使用されていない

**URL:** <https://meta.discourse.org/t/s3-cdn-url-not-being-used-on-non-image-uploads/175332>\
**Category:** Bug\
**Created:** [2021 年 1 月 7 日午前 1:24 UTC](https://meta.discourse.org/t/s3-cdn-url-not-being-used-on-non-image-uploads/175332 "2021-01-07T01:24:44Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![elle](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/elle/32/119940_2.png) [@elle](https://meta.discourse.org/u/elle)\
**Post date:** [2022 年 1 月 14 日午前 8:36 UTC](https://meta.discourse.org/t/s3-cdn-url-not-being-used-on-non-image-uploads/175332/7 "2022-01-14T08:36:21Z")

</div>

はい、私は\_サポートされていない\_S3プロバイダー（[OVH Object Storage](https://www.ovhcloud.com/en/public-cloud/object-storage/)）を使用しているようです。

エンドポイントURLは`https://s3.de.ovh.cloud.net`で、s3 cdn\_urlは`https://storage.de.ovh.cloud.net/v1/<some-unique-user-id>/<the-bucket-name>`に設定されています。

ショートURLが解決されるとき、DiscourseはエンドポイントURLを使用して結果のURLを構築します（これは正しいOVHユーザーIDが含まれていないため失敗します。これはs3 cdn\_urlの一部です）。

ただし、ショートURLに`dl=1`を強制すると、機能する署名付きURLが構築され、私にとっては問題ありません。

コンテナYAML内でこれらの（S3固有の）環境変数を設定しました。

```plaintext
DISCOURSE_USE_S3: true
DISCOURSE_S3_REGION: DE
DISCOURSE_S3_ENDPOINT: https://s3.de.cloud.ovh.net
DISCOURSE_S3_ACCESS_KEY_ID: ...
DISCOURSE_S3_SECRET_ACCESS_KEY: ...
DISCOURSE_S3_CDN_URL: https://storage.de.ovh.cloud.net/v1/<some-unique-user-id>/<the-bucket-name>
DISCOURSE_S3_UPLOAD_BUCKET: <the-bucket-name>
DISCOURSE_S3_INSTALL_CORS_RULE: false

```

---

_[View the full topic](https://meta.discourse.org/t/s3-cdn-url-not-being-used-on-non-image-uploads/175332)._
