> ## Documentation Index
> Fetch the complete documentation index at: https://enterprise-docs.dify.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Nginx Ingress Controller

## Nginx Ingress Controller のインストール方法

以下のコマンドを実行することで、Kubernetes クラスターに Nginx Ingress Controller をインストールできます：

```bash theme={null}
kubectl apply -f ./ingress-nginx-controller-v1.12.1.yaml
```

> [`ingress-nginx-controller-v1.12.1.yaml` ファイルをこちらからダウンロード](https://assets-docs.dify.ai/2025/07/727045c765d5052ef3cc2f4b15aaa492.yaml)

## Nginx Ingress Controller の設定方法

Nginx Ingress Controller を使用する場合は、`annotations` フィールドでファイルのアップロードサイズ上限を設定してください。

```yaml theme={null}
ingress:
  enabled: true
  className: "nginx"
  annotations: {
    # ファイルアップロードサイズの制限を設定
    nginx.ingress.kubernetes.io/proxy-body-size: "15m"
  }
  ... ...
```

## Dify Enterprise へのアクセス方法

Ingress Controller のセットアップが完了したら、まず Ingress Controller の外部 IP を取得します：

```bash theme={null}
kubectl get svc -n ingress-nginx
```

取得した外部 IP を、以下のように `/etc/hosts` ファイルに追加します：

```bash theme={null}
4.152.1.216 console.dify.local
4.152.1.216 app.dify.local
4.152.1.216 api.dify.local
4.152.1.216 upload.dify.local
4.152.1.216 enterprise.dify.local
4.152.1.216 trigger.dify.local
```

## 他の Ingress Controllers を使用する場合の対応方法

* 一般的に、クラウドプロバイダーは独自の Ingress Controller を提供しています。クラウドプロバイダーの Ingress Controller を使用することができます。詳細については、[Kubernetes ドキュメント](https://kubernetes.io/docs/concepts/services-networking/ingress-controllers/)を参照してください。
* `ファイルアップロードサイズの制限`: Ingress Controller の設定で `annotations` フィールドにファイルアップロードサイズの制限を設定する必要があります。例えば、Nginx Ingress Controller では `nginx.ingress.kubernetes.io/proxy-body-size: "15m"` を使用できます。
* `監査ログの IP`: Ingress Controller で `X-Forwarded-For` ヘッダーを設定して、クライアントの実際の IP アドレスを渡す必要があります。
