コンテンツにスキップ

ゾーンレベル

ゾーンの認証されたオリジンプルを有効にすると、ゾーンへのすべてのプロキシトラフィックはオリジンのウェブサーバーで認証されます。

始める前に

ゾーンがフル以上のSSL/TLS暗号化モードを使用していることを確認してください。

1. オリジンに証明書をアップロード

まず、オリジンに証明書をアップロードします。

Cloudflareの証明書(特定のCAを使用)を使用するには、PEMファイルをダウンロードし、それをオリジンにアップロードします。この証明書はCloudflareのオリジンCA証明書とは異なり、ダッシュボードには表示されません。

カスタム証明書を使用するには、APIの指示に従ってCloudflareにカスタム証明書をアップロードしますが、origin_tls_client_authエンドポイントを使用します。その後、証明書をオリジンにアップロードします。

2. オリジンをクライアント証明書を受け入れるように構成

With the certificate installed, set up your origin web server to accept client certificates.

Check the examples below for Apache and NGINX or refer to your origin web server documentation - e.g. HAProxy, Traefik, Caddy.

Apache example

SSLVerifyDepth 1
SSLCACertificateFile /path/to/origin-pull-ca.pem

For this example, you would have saved your certificate to /path/to/origin-pull-ca.pem.

Cloudflareの証明書を使用するには、上記のステップ1からダウンロードし、.PEMファイルの名前を変更してから、設定を適用する前に`/path/to/origin-pull-ca.pem`にアップロードします。

NGINX example

ssl_verify_client optional;
ssl_client_certificate /etc/nginx/certs/cloudflare.crt;

For this example, you would have saved your certificate to /etc/nginx/certs/cloudflare.crt.

Cloudflareの証明書を使用するには、上記のステップ1からダウンロードし、.PEMファイルの名前を変更してから、設定を適用する前に`/etc/nginx/certs/cloudflare.crt`にアップロードします。

At this point, you may also want to enable logging on your origin so that you can verify the configuration is working.

3. クライアント証明書を使用するようにCloudflareを構成

Then, enable the Authenticated Origin Pulls feature as an option for your Cloudflare zone.

This step sets the TLS Client Auth to require Cloudflare to use a client certificate when connecting to your origin server.

To enable Authenticated Origin Pulls in the dashboard:

  1. Log in to your Cloudflare account and go to a specific domain.
  2. Go to SSL/TLS > Origin Server.
  3. For Authenticated Origin Pulls, switch the toggle to On.

4. ゾーン内のすべてのホスト名に対して認証されたオリジンプルを有効にする

Cloudflare APIを使用して、ゾーンレベルの認証されたオリジンプルを有効にするためにPUTリクエストを送信します。

ステップ2でオリジンにロギングを設定していた場合は、認証されたオリジンプルが機能していることをテストして確認してください。

5. オリジンでの検証チェックを強制

Once you can confirm everything is working as expected for your specific origin setup, configure your origin to enforce the authentication.

Apache example

SSLVerifyClient require

NGINX example

ssl_verify_client on;

After completing the process, you can use curl to send requests directly to your origin IPs, verifying that the requests fail due to certificate validation being enforced.

6. (オプション)ゾーンレベルの認証されたオリジンプル証明書のアラートを設定

AOP証明書が期限切れになる前に通知を受け取るためのアラートを構成できます。

Refer to Cloudflare Notifications for more information on how to set up an alert.