コンテンツにスキップ

NGINXにおけるブロッキングページとエラーコードの設定

これらの手順は、ブロッキングリクエストに対するレスポンスで返されるブロッキングページおよびエラーコードをカスタマイズする方法について説明します。この設定は、セルフホスト型NGINXノードにのみ該当します。

カスタムブロッキングページは、以下の理由によりブロックされたリクエストに対して返されます:

設定の制限

ブロッキングページとエラーコードの設定は、NGINXベースのWallarmノード展開でサポートされていますが、Native Node、EnvoyベースおよびCDNベースのWallarmノード展開ではサポートされません。EnvoyベースおよびCDNベースのWallarmノードは、ブロックされたリクエストに対して常にコード403を返します。

設定方法

デフォルトでは、レスポンスコード403とNGINXのデフォルトブロッキングページがクライアントに返されます。以下のNGINXディレクティブを使用してデフォルト設定を変更できます:

  • wallarm_block_page

  • wallarm_block_page_add_dynamic_path

NGINXディレクティブ wallarm_block_page

wallarm_block_page NGINXディレクティブに以下のパラメータを指定することで、ブロッキングページおよびエラーコードを設定できます:

  • ブロッキングページのHTMまたはHTMLファイルへのパス。カスタムブロッキングページまたはWallarmが提供するサンプルブロッキングページへのパスのいずれかを指定できます。

  • ブロックされたリクエストに対して返されるメッセージのテキスト。

  • クライアントリダイレクトのためのURL。

  • response_code: レスポンスコード。

  • type: 指定した設定が返されるブロックされたリクエストの種別。このパラメータは、以下のリストから1つまたは複数の値(カンマで区切る)を受け付けます:

    • attack (デフォルト): ブロッキングまたはSafe modeでリクエストをフィルタリングするノードによりブロックされたリクエストの場合。
    • acl_ip: 単一オブジェクトまたはサブネットとしてdenylistに追加されたIPアドレスから発信されたリクエストの場合。
    • acl_source: 国、地域またはデータセンターごとにdenylistedとして登録されているIPアドレスから発信されたリクエストの場合。

wallarm_block_pageディレクティブは、以下の形式でパラメータを受け付けます:

  • ブロッキングページのHTMまたはHTMLファイルへのパス、エラーコード(オプション)、およびブロックされたリクエストの種別(オプション)

    wallarm_block_page &/<PATH_TO_FILE/HTML_HTM_FILE_NAME> response_code=<CUSTOM_CODE> type=<BLOCKED_REQUEST_TYPE>;
    

    Wallarmは、customizing-sample-blocking-pageとしてカスタマイズの出発点として使用できるサンプルブロッキングページを提供します。ページは以下のパスにあります:

    &/opt/wallarm/usr/share/nginx/html/wallarm_blocked.html
    
    &/usr/share/nginx/html/wallarm_blocked.html
    

    ブロッキングページ上でNGINX variablesを使用できます。このため、ブロッキングページのコードに${variable_name}形式で変数名を追加します。例として、ブロックされたリクエストの発信元IPアドレスを表示する${remote_addr}があります。

    DebianおよびCentOSユーザー向けの重要な情報

    CentOS/DebianのリポジトリからインストールされたNGINXバージョンが1.11未満の場合、動的ブロッキングページを正しく表示するために、ページコードからrequest_id変数を削除する必要があります:

    UUID ${request_id}
    

    これはwallarm_blocked.htmlおよびカスタムブロックページの両方に該当します。

    設定例 →

  • クライアントリダイレクトのURLおよびブロックされたリクエストの種別(オプション)

    wallarm_block_page /<REDIRECT_URL> type=<BLOCKED_REQUEST_TYPE>;
    

    設定例 →

  • NGINXの名前付きlocationとブロックされたリクエストの種別(オプション)

    wallarm_block_page @<NAMED_LOCATION> type=<BLOCKED_REQUEST_TYPE>;
    

    設定例 →

  • HTMまたはHTMLファイルへのパス、エラーコード(オプション)、およびブロックされたリクエストの種別(オプション)を設定する変数名

    wallarm_block_page &<VARIABLE_NAME> response_code=<CUSTOM_CODE> type=<BLOCKED_REQUEST_TYPE>;
    

    NGINX変数を使用してブロッキングページをコード内で初期化する場合

    この方法を使用してNGINX variablesがコード内で使用されるブロッキングページを設定する場合は、ディレクティブwallarm_block_page_add_dynamic_pathを使用してこのページを初期化してください。

    設定例 →

wallarm_block_pageディレクティブは、NGINX設定ファイルのhttpserverlocationブロック内に設定できます。

NGINXディレクティブ wallarm_block_page_add_dynamic_path

wallarm_block_page_add_dynamic_pathディレクティブは、コード内にNGINX変数が使用されているブロッキングページの初期化に使用します。また、このブロッキングページへのパスは変数を使用して設定されます。そうでない場合、このディレクティブは使用しません。

このディレクティブは、NGINX設定ファイルのhttpブロック内に設定できます。

カスタマイズサンプルブロッキングページ

Wallarmが提供するサンプルブロッキングページは、以下のようになっています:

Wallarm blocking page

このサンプルページをカスタマイズの出発点として使用し、以下の点を強化できます:

  • 自社のロゴの追加 – デフォルトではページにロゴは表示されません。

  • 自社のサポートメールの追加 – デフォルトではメールリンクは使用されず、contact usフレーズはリンクなしのシンプルなテキストです。

  • その他のHTML要素の変更や独自要素の追加。

カスタムブロッキングページのバリエーション

Wallarmが提供するサンプルページを変更するのではなく、最初からカスタムページを作成することもできます。

一般的な手順

サンプルページ自体を変更すると、Wallarmコンポーネントのアップデート時に変更が失われる可能性があります。そのため、サンプルページをコピーし、新しい名前を付けてから変更することを推奨します。以下の各インストールタイプに応じた手順に従ってください。

コピー用のサンプルページ

フィルタリングノードがインストールされている環境にある/usr/share/nginx/html/wallarm_blocked.html(または/opt/wallarm/usr/share/nginx/html/wallarm_blocked.html)のコピーを作成できます。あるいは、以下のコードをコピーして新しいファイルとして保存してください:

サンプルページコードの表示
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>You are blocked</title>
    <link href="https://fonts.googleapis.com/css?family=Poppins:700|Roboto|Roboto+Mono&display=swap" rel="stylesheet">
    <style>
        html {
            font-family: 'Roboto', sans-serif;
        }

        body {
            margin: 0;
            height: 100vh;
        }

        .content {
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            align-items: center;
            min-height: 100%;
        }

        .logo {
            margin-top: 32px;
        }

        .message {
            display: flex;
            margin-bottom: 100px;
        }

        .alert {
            padding-top: 20px;
            width: 246px;
            text-align: center;
        }

        .alert-title {
            font-family: 'Poppins', sans-serif;
            font-weight: bold;
            font-size: 24px;
            line-height: 32px;
        }

        .alert-desc {
            font-size: 14px;
            line-height: 20px;
        }

        .info {
            margin-left: 76px;
            border-left: 1px solid rgba(149, 157, 172, 0.24);
            padding: 20px 0 20px 80px;
            width: 340px;
        }

        .info-title {
            font-weight: bold;
            font-size: 20px;
            line-height: 28px;
        }

        .info-text {
            margin-top: 8px;
            font-size: 14px;
            line-height: 20px;
        }

        .info-divider {
            margin-top: 16px;
        }

        .info-data {
            margin-top: 12px;
            border: 1px solid rgba(149, 157, 172, 0.24);
            border-radius: 4px;
            padding: 9px 12px;
            font-size: 14px;
            line-height: 20px;
            font-family: 'Roboto Mono', monospace;
        }

        .info-copy {
            margin-top: 12px;

            padding: 6px 12px;
            border: none;
            outline: none;
            background: rgba(149, 157, 172, 0.08);
            cursor: pointer;
            transition: 0.24s cubic-bezier(0.24, 0.1, 0.24, 1);
            border-radius: 4px;

            font-size: 14px;
            line-height: 20px;
        }

        .info-copy:hover {
            background-color: rgba(149, 157, 172, 0.24);
        }

        .info-copy:active {
            background-color: rgba(149, 157, 172, 0.08);
        }

        .info-mailto,
        .info-mailto:visited {
            color: #fc7303;
        }
    </style>
    <script>
        // Place your support email here
        const SUPPORT_EMAIL = "";
    </script>
</head>

<body>
    <div class="content">
        <div id="logo" class="logo">
            <!--
                Place you logo here.
                You can use an external image:
                <img src="https://example.com/logo.png" width="160" alt="Company Name" />
                Or put your logo source code (like svg) right here:
                <svg width="160" height="80"> ... </svg>
            -->
        </div>

        <div class="message">
            <div class="alert">
                <svg width="207" height="207" viewBox="0 0 207 207" fill="none" xmlns="http://www.w3.org/2000/svg">
                    <path
                        d="M88.7512 33.2924L15.6975 155.25C14.1913 157.858 13.3943 160.816 13.3859 163.828C13.3775 166.84 14.1579 169.801 15.6494 172.418C17.141 175.035 19.2918 177.216 21.8877 178.743C24.4837 180.271 27.4344 181.092 30.4462 181.125H176.554C179.566 181.092 182.516 180.271 185.112 178.743C187.708 177.216 189.859 175.035 191.351 172.418C192.842 169.801 193.623 166.84 193.614 163.828C193.606 160.816 192.809 157.858 191.303 155.25L118.249 33.2924C116.711 30.7576 114.546 28.6618 111.963 27.2074C109.379 25.7529 106.465 24.9888 103.5 24.9888C100.535 24.9888 97.6206 25.7529 95.0372 27.2074C92.4538 28.6618 90.2888 30.7576 88.7512 33.2924V33.2924Z"
                        stroke="#F24444" stroke-width="16" stroke-linecap="round" stroke-linejoin="round" />
                    <path d="M103.5 77.625V120.75" stroke="#F24444" stroke-width="16" stroke-linecap="round"
                        stroke-linejoin="round" />
                    <path d="M103.5 146.625V146.668" stroke="#F24444" stroke-width="16" stroke-linecap="round"
                        stroke-linejoin="round" />
                </svg>
                <div class="alert-title">Malicious activity blocked</div>
                <div class="alert-desc">Your request is blocked since it was identified as a malicious one.</div>
            </div>
            <div class="info">
                <div class="info-title">Why it happened</div>
                <div class="info-text">
                    You might have used symbols similar to a malicious code sequence, or uploaded a specific file.
                </div>

                <div class="info-divider"></div>

                <div class="info-title">What to do</div>
                <div class="info-text">
                    If your request is considered to be legitimate, please <a id="mailto" href="" class="info-mailto">contact us</a> and provide your last action description and the following data:
                </div>

                <div id="data" class="info-data">
                    IP ${remote_addr}<br />
                    Blocked on ${time_iso8601}<br />
                    UUID ${request_id}
                </div>

                <button id="copy-btn" class="info-copy">
                    Copy details
                </button>
            </div>
        </div>
        <div></div>
    </div>
    <script>
        // Warning: ES5 code only

        function writeText(str) {
            const range = document.createRange();

            function listener(e) {
                e.clipboardData.setData('text/plain', str);
                e.preventDefault();
            }

            range.selectNodeContents(document.body);
            document.getSelection().addRange(range);
            document.addEventListener('copy', listener);
            document.execCommand('copy');
            document.removeEventListener('copy', listener);
            document.getSelection().removeAllRanges();
        }

        function copy() {
            const text = document.querySelector('#data').innerText;

            if (navigator.clipboard && navigator.clipboard.writeText) {
                return navigator.clipboard.writeText(text);
            }

            return writeText(text);
        }

        document.querySelector('#copy-btn').addEventListener('click', copy);

        const mailto = document.getElementById('mailto');
        if (SUPPORT_EMAIL) mailto.href = `mailto:${wallarm_dollar}{SUPPORT_EMAIL}`;
        else mailto.replaceWith(mailto.textContent);
    </script>
</body>

共通ファイルシステム

NGINXが読み取り権限を持つ任意の場所に、/usr/share/nginx/html/wallarm_blocked.html(または/opt/wallarm/usr/share/nginx/html/wallarm_blocked.html)を新しい名前でコピーできます。同一フォルダー内に配置しても構いません。

Dockerコンテナ

サンプルブロッキングページを変更する場合、または最初からカスタムページを提供する場合、Dockerのbind mount機能を使用できます。これを使用すると、ホストマシン上のページおよびNGINX設定ファイルがコンテナへコピーされ、元のファイルと参照されるため、ホストマシン上のファイルが変更されると、そのコピーも同期されます。

したがって、サンプルブロッキングページを変更する、またはカスタムページを提供するには、以下を実施します:

  1. 初回実行前に、copyによって変更済みのwallarm_blocked_renamed.htmlを準備します。

  2. ブロッキングページへのパスを含むNGINX設定ファイルを準備します。設定例はこちらを参照してください。

  3. 準備済みのブロッキングページおよび設定ファイルをmountingしてコンテナを実行します。

  4. 後に実行中のコンテナでブロッキングページを更新する必要がある場合、ホストマシン上で参照されるwallarm_blocked_renamed.htmlを変更し、コンテナ内でNGINXを再起動します。

Ingressコントローラー

サンプルブロッキングページを変更する、またはカスタムページを提供するには、以下を実施します:

  1. copyによって変更済みのwallarm_blocked_renamed.htmlを準備します。

  2. ファイルConfigMapの作成を実施してwallarm_blocked_renamed.htmlを作成します。

  3. 作成済みのConfigMapをWallarm IngressコントローラーのPodにマウントします。このため、instructionsに従い、Deploymentオブジェクトを更新します。

    ConfigMapマウントディレクトリ

    ConfigMapをマウントするディレクトリ内の既存ファイルは削除される可能性があるため、ConfigMapでマウントされるファイル用に新しいディレクトリを作成することを推奨します。

  4. Ingressアノテーションにより、Podにカスタムページの使用を指示します:

    kubectl annotate ingress <INGRESS_NAME> -n <INGRESS_NAMESPACE> nginx.ingress.kubernetes.io/wallarm-block-page="&/usr/share/nginx/blockpages/wallarm_blocked_renamed.html response_code=445 type=attack;&/usr/share/nginx/blockpages/wallarm_blocked_renamed-2.html response_code=445 type=acl_ip,acl_source"
    

頻繁に行う変更

自社のロゴを追加する場合は、wallarm_blocked_renamed.htmlファイル内で以下の部分を変更し、コメントアウトを解除してください:

<div class="content">
    <div id="logo" class="logo">
        <!--
            Place you logo here.
            You can use an external image:
            <img src="https://example.com/logo.png" width="160" alt="Company Name" />
            Or put your logo source code (like svg) right here:
            <svg width="160" height="80"> ... </svg>
        -->
    </div>

自社のサポートメールを追加する場合は、wallarm_blocked_renamed.htmlファイル内でSUPPORT_EMAIL変数を以下のように変更してください:

<script>
    // Place your support email here
    const SUPPORT_EMAIL = "support@company.com";
</script>

値内で$を含むカスタム変数を初期化する場合、変数名の前に{wallarm_dollar}を追加してこのシンボルをエスケープします。例: ${wallarm_dollar}{variable_name}wallarm_dollar変数は&を返します。

設定例

以下は、wallarm_block_pageおよびwallarm_block_page_add_dynamic_pathディレクティブを使用して、ブロッキングページとエラーコードを設定する例です。

wallarm_block_pageディレクティブのtypeパラメータは、各例で明示的に指定されています。typeパラメータを削除した場合、設定されたブロックページ、メッセージ等は、フィルタリングノードがブロッキングまたはSafe modeでリクエストをブロックした場合にのみ返されます。

ブロッキングページおよびエラーコード付きHTMまたはHTMLファイルへのパス

この例では、以下のレスポンス設定を示します:

  • フィルタリングノードがブロッキングまたはSafe modeでリクエストをブロックした際に、customizing-sample-blocking-pageで変更されたサンプルWallarmブロッキングページ/opt/wallarm/usr/share/nginx/html/wallarm_blocked_renamed.htmlとエラーコード445を返す場合。

  • 任意のdenylisted IPアドレスから発信されたリクエストの場合、カスタムブロッキングページ/usr/share/nginx/html/block.htmlとエラーコード445を返す場合。

NGINX設定ファイル

wallarm_block_page &/opt/wallarm/usr/share/nginx/html/wallarm_blocked_renamed.html response_code=445 type=attack;
wallarm_block_page &/usr/share/nginx/html/block.html response_code=445 type=acl_ip,acl_source;

設定をDockerコンテナに適用するには、該当する設定が記述されたNGINX設定ファイルをwallarm_blocked_renamed.htmlおよびblock.htmlファイルと共にコンテナにマウントしてください。Running the container mounting the configuration file →

Ingressアノテーション

Ingressアノテーションを追加する前に:

  1. ブロックされた攻撃用の変更済みwallarm_blocked_renamed.htmlと、denylisted IPからのリクエスト用のwallarm_blocked_renamed-2.htmlcopyしてください。

  2. 以下を実行してファイルからConfigMapを作成します:

    kubectl -n <CONTROLLER_NAMESPACE> create configmap customized-pages --from-file=wallarm_blocked_renamed.html --from-file=wallarm_blocked_renamed-2.html
    
  3. 作成済みのConfigMapをWallarm IngressコントローラーのPodにmountします:

    • 使用するvalues.yamlを以下のように更新します:

      controller:
          wallarm:
          <...>
          # -- コントローラのメインコンテナに追加するvolumeMounts.
          extraVolumeMounts:
          - name: custom-block-pages
            mountPath: /usr/share/nginx/blockpages
          # -- コントローラPodに追加するvolumes.
          extraVolumes:
          - name: custom-block-pages
            configMap:
            name: customized-pages
          <...>
      
    • 以下を実行してリリースに変更を適用します:

      helm -n <CONTROLLER_NAMESPACE> upgrade <CHART-RELEASE-NAME> wallarm/wallarm-ingress --reuse-values -f values.yaml
      

      ConfigMapマウントディレクトリ

      ConfigMapでマウントされるディレクトリ内の既存ファイルは削除される可能性があるため、ConfigMapでマウントされるファイル用に新しいディレクトリを作成することを推奨します。

Ingressアノテーション:

kubectl -n <INGRESS_NAMESPACE> annotate ingress <INGRESS_NAME> nginx.ingress.kubernetes.io/wallarm-block-page="&/usr/share/nginx/blockpages/wallarm_blocked_renamed.html response_code=445 type=attack;&/usr/share/nginx/blockpages/wallarm_blocked_renamed-2.html response_code=445 type=acl_ip,acl_source"

Podアノテーション (Sidecar controller使用時)

ブロックページは、sidecar.wallarm.io/wallarm-block-pageアノテーションを用いてPod単位で設定できます。例:

apiVersion: apps/v1
kind: Deployment
metadata:
  name: myapp
  namespace: default
spec:
  replicas: 1
  selector:
    matchLabels:
      app: myapp
  template:
    metadata:
      labels:
        app: myapp
        wallarm-sidecar: enabled
      annotations:
        sidecar.wallarm.io/wallarm-mode: block
        sidecar.wallarm.io/wallarm-block-page: "&/path/to/block/page1.html response_code=403 type=attack;&/path/to/block/page2.html response_code=403 type=acl_ip,acl_source"
    spec:
      containers:
        - name: application
          image: kennethreitz/httpbin
          ports:
            - name: http
              containerPort: 80

クライアントリダイレクト用URL

この例では、denylistedな国、地域またはデータセンターから発信されたリクエストがブロックされた場合、クライアントをhost/err445にリダイレクトする設定を示します。

NGINX設定ファイル

wallarm_block_page /err445 type=acl_source;

設定をDockerコンテナに適用するには、該当する設定が記述されたNGINX設定ファイルをコンテナにマウントしてください。Running the container mounting the configuration file →

Ingressアノテーション

kubectl annotate ingress <INGRESS_NAME> -n <INGRESS_NAMESPACE> nginx.ingress.kubernetes.io/wallarm-block-page="/err445 type=acl_source"

名前付きNGINX location

この例では、ブロック理由(ブロッキングまたはSafe mode、単一IP/サブネット、国や地域、データセンター)に関係なく、クライアントに対してThe page is blockedというメッセージとエラーコード445を返す設定を示します。

NGINX設定ファイル

wallarm_block_page @block type=attack,acl_ip,acl_source;
location @block {
    return 445 'The page is blocked';
}

設定をDockerコンテナに適用するには、該当する設定が記述されたNGINX設定ファイルをコンテナにマウントしてください。Running the container mounting the configuration file →

Ingressアノテーション

kubectl annotate ingress <INGRESS_NAME> -n <INGRESS_NAMESPACE> nginx.ingress.kubernetes.io/server-snippet="location @block {return 445 'The page is blocked';}"
kubectl annotate ingress <INGRESS_NAME> -n <INGRESS_NAMESPACE> nginx.ingress.kubernetes.io/wallarm-block-page="@block type=attack,acl_ip,acl_source"

変数とエラーコード

この設定は、denylistedなソース(単一IPまたはサブネット)から発信されたリクエストに対して返されます。Wallarmノードは、コード445と、User-Agentヘッダーの値に依存するコンテンツのブロッキングページを返します:

  • デフォルトでは、customizing-sample-blocking-pageで変更されたサンプルWallarmブロッキングページ/opt/wallarm/usr/share/nginx/html/wallarm_blocked_renamed.htmlが返されます。NGINX変数がブロッキングページのコード内で使用されているため、このページはディレクティブwallarm_block_page_add_dynamic_pathで初期化する必要があります。

  • Firefoxユーザー向け — /usr/share/nginx/html/block_page_firefox.html(Wallarm Ingressコントローラーを展開している場合、カスタムブロックページファイル用に別のディレクトリ、例:/usr/custom-block-pages/block_page_firefox.htmlを作成することを推奨します):

    You are blocked!
    
    IP ${remote_addr}
    Blocked on ${time_iso8601}
    UUID ${request_id}
    

    NGINX変数がブロッキングページのコード内で使用されているため、このページはディレクティブwallarm_block_page_add_dynamic_pathで初期化する必要があります。

  • Chromeユーザー向け — /usr/share/nginx/html/block_page_chrome.html(Wallarm Ingressコントローラーを展開している場合、カスタムブロックページファイル用に別のディレクトリ、例:/usr/custom-block-pages/block_page_chrome.htmlを作成することを推奨します):

    You are blocked!
    

    NGINX変数がブロッキングページのコード内で使用されていないため、このページは初期化する必要はありません。

NGINX設定ファイル

wallarm_block_page_add_dynamic_path /usr/share/nginx/html/block_page_firefox.html /opt/wallarm/usr/share/nginx/html/wallarm_blocked_renamed.html;

map $http_user_agent $block_page {
  "~Firefox"  &/usr/share/nginx/html/block_page_firefox.html;
  "~Chrome"   &/usr/share/nginx/html/block_page_chrome.html;
  default     &/opt/wallarm/usr/share/nginx/html/wallarm_blocked_renamed.html;
}

wallarm_block_page $block_page response_code=445 type=acl_ip;

設定をDockerコンテナに適用するには、該当する設定が記述されたNGINX設定ファイルを、wallarm_blocked_renamed.htmlblock_page_firefox.htmlおよびblock_page_chrome.htmlファイルと共にコンテナにマウントしてください。Running the container mounting the configuration file →

Ingressコントローラー

  1. helm upgradeコマンドを使用して、デプロイ済みHelmチャートにcontroller.config.http-snippetパラメータを渡してください:

    helm upgrade --reuse-values --set controller.config.http-snippet='wallarm_block_page_add_dynamic_path /usr/custom-block-pages/block_page_firefox.html /opt/wallarm/usr/share/nginx/html/wallarm_blocked_renamed.html; map $http_user_agent $block_page { "~Firefox" &/usr/custom-block-pages/block_page_firefox.html; "~Chrome" &/usr/custom-block-pages/block_page_chrome.html; default &/opt/wallarm/usr/share/nginx/html/wallarm_blocked_renamed.html;}' <INGRESS_CONTROLLER_RELEASE_NAME> wallarm/wallarm-ingress -n <KUBERNETES_NAMESPACE>
    
  2. wallarm_blocked_renamed.htmlblock_page_firefox.html、およびblock_page_chrome.htmlファイルからConfigMapを作成します。

  3. 作成済みのConfigMapをWallarm IngressコントローラーのPodにマウントします。このため、instructionsに従い、該当するDeploymentオブジェクトを更新してください。

    ConfigMapマウントディレクトリ

    ConfigMapでマウントされるディレクトリ内の既存ファイルは削除される可能性があるため、ConfigMapでマウントされるファイル用に新しいディレクトリを作成することを推奨します。

  4. 以下のアノテーションをIngressに追加します:

    kubectl annotate ingress <INGRESS_NAME> -n <INGRESS_NAMESPACE> nginx.ingress.kubernetes.io/wallarm-block-page='$block_page response_code=445 type=acl_ip'