> For the complete documentation index, see [llms.txt](https://help.aikido.dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://help.aikido.dev/docs/docs-ja/zen-firewall/zen-installation-instructions/proxy-load-balancer-settings.md).

# プロキシとロードバランサーの設定

## プロキシとクライアントの IP アドレス <a href="#proxy--clients-ip-address" id="proxy--clients-ip-address"></a>

次を自動的に使用します `x-forwarded-for` ヘッダーを使用して、プロキシの背後にある場合にクライアントの IP アドレスを判定します。

ロードバランサーを前面に置かずにサーバーを公開する場合は、 `AIKIDO_TRUST_PROXY` 環境変数を `false` 正しい IP アドレスが使用されるようにしてください。そうしないと、上記のヘッダーを追加して IP アドレスを偽装し、レート制限を回避できる可能性があります。

クライアントの IP アドレスを判定するために別のヘッダーを使う必要がある場合は、 `AIKIDO_CLIENT_IP_HEADER` そのヘッダー名に環境変数を設定できます。これにより、デフォルトの `x-forwarded-for` ヘッダー:

```bash
# DigitalOcean App Platform の例
AIKIDO_CLIENT_IP_HEADER=do-connecting-ip node app.js
```

Rubyでは、ヘッダー名の代わりにRackの環境キーを使用してください。たとえば、 `HTTP_FLY_CLIENT_IP` 〜のために `Fly-Client-IP` ヘッダーを設定します。

## レート制限とロードバランサー <a href="#rate-limiting--load-balancers" id="rate-limiting--load-balancers"></a>

デフォルトでは、各 Zen インスタンスは独自のレート制限カウンターを保持します。つまり、アプリケーションのインスタンスが 3 つあり、レート制限を 1 分あたり 10 に設定すると、理論上は顧客は 30 件のリクエストを送信できることになります（サーバーごとに 10 件）。

ラウンドロビン負荷分散の場合、Aikido はインスタンス数に基づいてレート制限を計算できます。上の例では、設定どおり顧客が送信できる最大リクエスト数は 10 件になります。

このオプションは、特定の Zen アプリを表示しているときに「Routes」タブ内の「Advanced Options」で見つけられます。

![レート制限の設定オプション: インスタンスベース vs. 分散、インスタンスベースが選択されています。](https://715870456-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FyKbzcQGrx7UtrG0nPZZ7%2Fuploads%2Fgit-blob-96a3e451a1fc2e8514cad0f94c3afb0a5f63127c%2Fproxy-load-balancer-settings_f66668ca-4803-4a4a-b833-ad4277b7447c.png?alt=media)

## ASP.NET Core の追加設定 <a href="#additional-configuration-for-aspnet-core" id="additional-configuration-for-aspnet-core"></a>

[ASP.NET](http://asp.net) Core は自動的には取得しません `x-forwarded-for` 追加設定なしでは。詳細については、 [Microsoft のドキュメント](https://learn.microsoft.com/en-us/aspnet/core/host-and-deploy/proxy-load-balancer?view=aspnetcore-9.0\&preserve-view=true).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://help.aikido.dev/docs/docs-ja/zen-firewall/zen-installation-instructions/proxy-load-balancer-settings.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
