> 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` ヘッダー:

{% hint style="warning" %}
`AIKIDO_CLIENT_IP_HEADER` は現在、Node.js、Java、およびPythonでのみサポートされています
{% endhint %}

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

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

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

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

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

![レート制限の設定オプション：インスタンスベースと分散型。インスタンスベースが選択されています。](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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
