# 埋め込み画像がメールで https://domain.com:80 に設定されています

**URL:** https://meta.discourse.org/t/embed-images-are-set-to-https-domain-com-80-in-email/127967
**Category:** Self-hosting
**Created:** [2019 年 9 月 8 日午後 4:17 UTC](https://meta.discourse.org/t/embed-images-are-set-to-https-domain-com-80-in-email/127967 "2019-09-08T16:17:15Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![Senthil](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/senthil/32/116238_2.png) [@Senthil](https://meta.discourse.org/u/Senthil)
#### Post date: [2019 年 9 月 8 日午後 4:17 UTC](https://meta.discourse.org/t/embed-images-are-set-to-https-domain-com-80-in-email/127967/1 "2019-09-08T16:17:16Z")

</div>

最近、サーバーを移行したところ、Discourse インスタンスの前にカスタム Nginx が設定されていません。  
これはクイックスタートガイドに従ってセットアップされた、通常の素の Discourse です。コンテンツは別のサーバーから移行されました。

インスタンスから送信されるメールを見ると、ドメインが **[https://domain.org:80](https://domain.org:80)** のように設定されていることがわかります。

> [https://thinnal.org:80/user\_avatar/thinnal.org/senthil\_kumaran/45/513\_2.png](https://thinnal.org:80/user_avatar/thinnal.org/senthil_kumaran/45/513_2.png)

これにより画像が破損しています。何が起きている可能性が高く、どこでリセットすればよいか、ご教示いただけますでしょうか。

---

<div class="post-metadata">

### Author: ![itsbhanusharma](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/itsbhanusharma/32/180717_2.png) [@itsbhanusharma](https://meta.discourse.org/u/itsbhanusharma)
#### Post date: [2019 年 9 月 8 日午後 4:37 UTC](https://meta.discourse.org/t/embed-images-are-set-to-https-domain-com-80-in-email/127967/2 "2019-09-08T16:37:22Z")

</div>

`force_https` は有効ですか？

---

<div class="post-metadata">

### Author: ![Senthil](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/senthil/32/116238_2.png) [@Senthil](https://meta.discourse.org/u/Senthil)
#### Post date: [2019 年 9 月 8 日午後 4:58 UTC](https://meta.discourse.org/t/embed-images-are-set-to-https-domain-com-80-in-email/127967/3 "2019-09-08T16:58:05Z")

</div>

新しい Discourse インスタンスの「設定」にはそれが見つかりません。（私の環境は最新バージョン：2.4.0.beta4）

おそらく、ある時点でこの設定が削除されたのだと思います。

---

<div class="post-metadata">

### Author: ![Senthil](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/senthil/32/116238_2.png) [@Senthil](https://meta.discourse.org/u/Senthil)
#### Post date: [2019 年 9 月 8 日午後 5:06 UTC](https://meta.discourse.org/t/embed-images-are-set-to-https-domain-com-80-in-email/127967/4 "2019-09-08T17:06:09Z")

</div>

> [@Senthil](#):
>
> 私の推測では、ある時点でこの設定が削除されたのだと思います。

はい

> <https://github.com/discourse/discourse_docker/commit/40fd876d1edb1a376a4eb592c9de4a178352a760>

私の Let’s Encrypt 証明書が有効なため、`force_https` が true に設定されているのが確認できます。

```
/var/www/discourse# cat config/discourse.conf |grep force_https
force_https = 'true'

```

さて、絵文字埋め込みやメール画像埋め込みで `https://domain.org:80` が発生している問題をどのように解決すればよいでしょうか。  
これは S3 インスタンスの HTTPS 設定に関係しているのでしょうか？

---

<div class="post-metadata">

### Author: ![Senthil](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/senthil/32/116238_2.png) [@Senthil](https://meta.discourse.org/u/Senthil)
#### Post date: [2019 年 9 月 8 日午後 5:27 UTC](https://meta.discourse.org/t/embed-images-are-set-to-https-domain-com-80-in-email/127967/5 "2019-09-08T17:27:26Z")

</div>

認証後のリダイレクトが以下の URL になりました:

> [https://domain.org:80/?authComplete=true](https://domain.org:80/?authComplete=true)

私のドームの末尾に「:80」を追加したのは誰ですか？

---

<div class="post-metadata">

### Author: ![Senthil](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/senthil/32/116238_2.png) [@Senthil](https://meta.discourse.org/u/Senthil)
#### Post date: [2019 年 9 月 8 日午後 5:53 UTC](https://meta.discourse.org/t/embed-images-are-set-to-https-domain-com-80-in-email/127967/6 "2019-09-08T17:53:49Z")

</div>

他の投稿を参考に、以下の手順で問題を解決しました。

```
$./launcher enter app
$ cd /var/www/discourse
/var/www/discourse# rails c
[1] pry(main)> SiteSetting.port
=> "80"
[2] pry(main)> SiteSetting.port=nil
=> nil
[3] pry(main)>

```

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [2019 年 9 月 8 日午後 7:04 UTC](https://meta.discourse.org/t/embed-images-are-set-to-https-domain-com-80-in-email/127967/7 "2019-09-08T19:04:25Z")

</div>

ポートは開発者専用の設定であり、本番インスタンスで設定されるべきではありません。そのため、どのようにその状態になったのかは不明です。

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [2019 年 10 月 8 日午後 7:04 UTC](https://meta.discourse.org/t/embed-images-are-set-to-https-domain-com-80-in-email/127967/8 "2019-10-08T19:04:30Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
