# ジオブロッキングプラグイン

**URL:** https://meta.discourse.org/t/geo-blocking-plugin/227824
**Category:** Plugin
**Created:** [2022 年 5 月 23 日午前 9:43 UTC](https://meta.discourse.org/t/geo-blocking-plugin/227824 "2022-05-23T09:43:22Z")
**Posts on this page:** 20
**Page:** 2

<div class="post-metadata">

### Author: ![Jagster](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jagster/32/192154_2.png) [@Jagster](https://meta.discourse.org/u/Jagster)
#### Post date: [2025 年 6 月 18 日午前 10:42 UTC](https://meta.discourse.org/t/geo-blocking-plugin/227824/23 "2025-06-18T10:42:33Z")

</div>

“RGJ、投稿：20、トピック：227824”  
「それが「ハード」ブロックを引き起こすことに注意してください。プラグインは、ブロックされたユーザーに表示できる、素敵で設定可能なメッセージを提供します」

何を推測できるでしょうか…その98％はボットです😜 メッセージを表示するかしないか…それは場合によります。もしジオIPでブロックされた実在の人間がVPNを使用するように誘導する必要がある場合、その理由を示すのは賢明な選択です。ただし、ボットにとっては時間の無駄です。

---

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [2025 年 6 月 18 日午前 10:43 UTC](https://meta.discourse.org/t/geo-blocking-plugin/227824/24 "2025-06-18T10:43:35Z")

</div>

> [@Jagster](#):
>
> 何を推測できるでしょうか…その98％はボットです

そのプラグインは、当初、特定の国に対する経済制裁を強制するために作成されました。

---

<div class="post-metadata">

### Author: ![Jagster](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jagster/32/192154_2.png) [@Jagster](https://meta.discourse.org/u/Jagster)
#### Post date: [2025 年 7 月 23 日午後 1:59 UTC](https://meta.discourse.org/t/geo-blocking-plugin/227824/25 "2025-07-23T13:59:41Z")

</div>

これにより、現在エラー500が発生しています。ただし、再構築は問題なく行われています。

修正可能でしょうか？

そうでなければ、リバースプロキシとして機能するようにNginxをインストールする必要があります。その場合、ここでサポートを求めるのは非常に怖くなります😂

---

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [2025 年 7 月 23 日午後 6:30 UTC](https://meta.discourse.org/t/geo-blocking-plugin/227824/26 "2025-07-23T18:30:30Z")

</div>

修正済み

@juanjosegzl あなたのLLMが熱心すぎたため、あなたのPRを十分にテストできなかったようです

---

<div class="post-metadata">

### Author: ![juanjosegzl](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/juanjosegzl/32/511141_2.png) [@juanjosegzl](https://meta.discourse.org/u/juanjosegzl)
#### Post date: [2025 年 7 月 23 日午後 7:19 UTC](https://meta.discourse.org/t/geo-blocking-plugin/227824/27 "2025-07-23T19:19:37Z")

</div>

すみません、自分のユースケースに集中しすぎていて、聞き取れませんでした。

---

<div class="post-metadata">

### Author: ![Jagster](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jagster/32/192154_2.png) [@Jagster](https://meta.discourse.org/u/Jagster)
#### Post date: [2025 年 7 月 24 日午後 9:31 UTC](https://meta.discourse.org/t/geo-blocking-plugin/227824/28 "2025-07-24T21:31:05Z")

</div>

申し訳ありませんが、まだ問題があります。

> [@Every post needs approval, even shouldn’t](https://meta.discourse.org/t/every-post-needs-approval-even-shouldn-t/375694):
>
> Every post from everyone, including admin and moderators, goes to review queue. This started some days ago. All relevant settings are as should (TL0 is approved) and no category is wanting approval. I have strange feeling that is somehow connected to groups or trustlevel names/translations — but my feelings can’t be trusted. safe-mode didn’t help. Logs are clean. Two container setup, and upgraded few times in three days time. Ideas what should I check next?

---

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [2025 年 7 月 25 日午前 8:15 UTC](https://meta.discourse.org/t/geo-blocking-plugin/227824/29 "2025-07-25T08:15:04Z")

</div>

プラグインの最新のPRを元に戻しました。数週間後に時間があるときに再検討します。ご迷惑をおかけして申し訳ありません。

---

<div class="post-metadata">

### Author: ![Jagster](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jagster/32/192154_2.png) [@Jagster](https://meta.discourse.org/u/Jagster)
#### Post date: [2025 年 7 月 25 日午前 8:21 UTC](https://meta.discourse.org/t/geo-blocking-plugin/227824/30 "2025-07-25T08:21:42Z")

</div>

そういうこともあります。しかし、そのプラグインは本当に必要です。ご尽力に感謝します。

---

<div class="post-metadata">

### Author: ![juanjosegzl](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/juanjosegzl/32/511141_2.png) [@juanjosegzl](https://meta.discourse.org/u/juanjosegzl)
#### Post date: [2025 年 7 月 27 日午後 3:16 UTC](https://meta.discourse.org/t/geo-blocking-plugin/227824/31 "2025-07-27T15:16:21Z")

</div>

申し訳ありません、すべての問題について、変更を再確認したところ、モデレーションに問題があることがわかりました。修正しました。

Richard 変更をプッシュしました。基本的にモデレーションの問題を修正し、モデレーション設定が変更されたときにキャッシュを無効にしました。

---

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [2025 年 7 月 27 日午後 4:08 UTC](https://meta.discourse.org/t/geo-blocking-plugin/227824/32 "2025-07-27T16:08:46Z")

</div>

ありがとうございます。  
現在旅行中ですので、10日後にプルリクエストを再度確認します。

---

<div class="post-metadata">

### Author: ![Jagster](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jagster/32/192154_2.png) [@Jagster](https://meta.discourse.org/u/Jagster)
#### Post date: [2025 年 7 月 27 日午後 4:21 UTC](https://meta.discourse.org/t/geo-blocking-plugin/227824/33 "2025-07-27T16:21:11Z")

</div>

私には動作します。ジオブロッキング自体はまだテストしていません。

さて、匿名ユーザーが速すぎたタイピングをしてしまいましたが、これは私が仮想キーボード付きのiPadを使っているから面白いのですが、このプラグインとは全く関係ありません😂

ありがとうございます。

---

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [2025 年 8 月 12 日午後 12:45 UTC](https://meta.discourse.org/t/geo-blocking-plugin/227824/34 "2025-08-12T12:45:50Z")

</div>

@juanjosegzl 最新のプルリクエストをマージしました。貴重なご協力ありがとうございます！

---

<div class="post-metadata">

### Author: ![LotusJeff](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lotusjeff/32/477888_2.png) [@LotusJeff](https://meta.discourse.org/u/LotusJeff)
#### Post date: [2026 年 3 月 15 日午前 2:30 UTC](https://meta.discourse.org/t/geo-blocking-plugin/227824/35 "2026-03-15T02:30:51Z")

</div>

Cloudflareを使用している場合、これは機能しますか？

Cloudflareは、`CF-IPCountry`ヘッダー変数にIPアドレスを送信します。

---

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [2026 年 3 月 15 日午前 3:15 UTC](https://meta.discourse.org/t/geo-blocking-plugin/227824/36 "2026-03-15T03:15:36Z")

</div>

はい、このガイドに従えば動作します。[Using Discourse with Cloudflare: Best Practices](https://meta.discourse.org/t/using-discourse-with-cloudflare-best-practices/293405#p-1444851-additional-configuration-for-self-hosted-installations-13)

> [@LotusJeff](#):
>
> Cloudflare は CF-IPCountry ヘッダー変数に IP アドレスを送信します。

これは間違いです。Cloudflare は、有効にした場合にのみ、そのヘッダーに国コードを送信し、IP アドレスではありません。ただし、プラグインはそれを使用しません。Discourse の内部 Maxmind データベースを使用します。

---

<div class="post-metadata">

### Author: ![singi2016cn](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/singi2016cn/32/532755_2.png) [@singi2016cn](https://meta.discourse.org/u/singi2016cn)
#### Post date: [2026 年 3 月 30 日午前 3:45 UTC](https://meta.discourse.org/t/geo-blocking-plugin/227824/37 "2026-03-30T03:45:06Z")

</div>

こんにちは、プラグインは素晴らしいです。小さなリクエストがあります：カスタムメッセージを設定できるオプションを追加することはできますか？

ああ、わかりました。`/admin/customize/site_texts` のサイトテキスト機能を使用すれば、追加の設定は不要ですね。

---

<div class="post-metadata">

### Author: ![singi2016cn](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/singi2016cn/32/532755_2.png) [@singi2016cn](https://meta.discourse.org/u/singi2016cn)
#### Post date: [2026 年 4 月 9 日午前 6:11 UTC](https://meta.discourse.org/t/geo-blocking-plugin/227824/38 "2026-04-09T06:11:04Z")

</div>

こんにちは。制限された地域からの特定の IP アドレスへのアクセスを許可したい場合、どのように設定すればよいでしょうか？

私は以下のプルリクエストを作成しました：  
[add ip whitelist by singi2016cn · Pull Request #8 · communiteq/discourse-geo-blocking](https://github.com/communiteq/discourse-geo-blocking/pull/8)

---

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [2026 年 4 月 9 日午前 7:26 UTC](https://meta.discourse.org/t/geo-blocking-plugin/227824/39 "2026-04-09T07:26:58Z")

</div>

PR をありがとうございます。対応しました。機能強化は歓迎ですが、すべてのリクエストで追加のデータベース呼び出しが発生するのは問題です。コードを遅延読み込みのキャッシュブロック内に移動していただければ、承認できます。

---

<div class="post-metadata">

### Author: ![singi2016cn](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/singi2016cn/32/532755_2.png) [@singi2016cn](https://meta.discourse.org/u/singi2016cn)
#### Post date: [2026 年 4 月 9 日午前 7:41 UTC](https://meta.discourse.org/t/geo-blocking-plugin/227824/40 "2026-04-09T07:41:31Z")

</div>

はい、問題の原因が分かりました。修正後に再度マージリクエストを提出します。もう一度ご確認をお願いします。

---

<div class="post-metadata">

### Author: ![singi2016cn](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/singi2016cn/32/532755_2.png) [@singi2016cn](https://meta.discourse.org/u/singi2016cn)
#### Post date: [2026 年 5 月 9 日午前 2:25 UTC](https://meta.discourse.org/t/geo-blocking-plugin/227824/41 "2026-05-09T02:25:45Z")

</div>

こんにちは、新しい要件があります。  
特定の国のみをアクセス可能にし、大多数の国にはアクセスを提供しないようにしたいと考えています。その場合、geo\_blocking\_country\_region\_allowlist のような設定を追加する必要があり、この設定が存在する場合はユーザーがその範囲内にあるかを確認し、含まれていれば許可し、そうでなければブロックします。  
geo\_blocking\_country\_region\_blocklist と geo\_blocking\_country\_region\_allowlist の両方が設定されている場合は、geo\_blocking\_country\_region\_allowlist のみを確認し、そうでない場合に geo\_blocking\_country\_region\_blocklist を確認します。

---

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [2026 年 5 月 9 日午前 5:03 UTC](https://meta.discourse.org/t/geo-blocking-plugin/227824/42 "2026-05-09T05:03:44Z")

</div>

> [@singi2016cn](#):
>
> geo\_blocking\_country\_region\_blocklist と geo\_blocking\_country\_region\_allowlist の両方が設定されている場合、geo\_blocking\_country\_region\_allowlist のみが評価されます。geo\_blocking\_country\_region\_allowlist が設定されていない場合は、geo\_blocking\_country\_region\_blocklist が評価されます。

現在の機能との後方互換性を保つために、以下の対応を行っていただければ、PR を歓迎します。

「allowlist 以外をすべてブロック」という追加設定を設け、その設定が有効になっている場合のみ、上記のように動作するようにしてください。

[Previous page](https://meta.discourse.org/t/geo-blocking-plugin/227824.md?page=1)

[Next page](https://meta.discourse.org/t/geo-blocking-plugin/227824.md?page=3)
