コンテンツにスキップ

Cloudflareトンネルの作成

クライアントレスでアプリケーションにアクセスするには、パブリックホスト名ルートを含むCloudflareトンネルを作成する必要があります。パブリックホスト名ルートは、特定のアドレス、プロトコル、およびプライベートアプリケーションに関連付けられたポートにトラフィックをルーティングするパブリックDNSレコードを作成します。たとえば、mywebapp.example.comというパブリックホスト名を定義して、https://localhost:8080で実行されているWebサーバーへのアクセスを提供できます。ユーザーがブラウザでmywebapp.example.comにアクセスすると、そのリクエストは最初にCloudflareデータセンターにルーティングされ、そこで設定されたセキュリティポリシーに対して検査されます。Cloudflareは、検証されたリクエストをトンネル経由でWebサーバーに転送します。

Cloudflareトンネルに接続されたプライベートアプリケーションにHTTPリクエストが到達する方法

トンネルの作成

Cloudflareトンネルを作成するには:

  1. Log in to Zero Trust and go to Networks > Tunnels.

  2. Select Create a tunnel.

  3. Choose Cloudflared for the connector type and select Next.

  4. Enter a name for your tunnel. We suggest choosing a name that reflects the type of resources you want to connect through this tunnel (for example, enterprise-VPC-01).

  5. Select Save tunnel.

  6. Next, you will need to install cloudflared and run it. To do so, check that the environment under Choose an environment reflects the operating system on your machine, then copy the command in the box below and paste it into a terminal window. Run the command.

  7. Once the command has finished running, your connector will appear in Zero Trust.

    Connector appearing in the UI after cloudflared has run

  8. Select Next.

アプリケーションの接続

トンネルにパブリックホスト名ルートを追加するには:

  1. In the Public Hostnames tab, choose a Domain and specify any subdomain or path information.

  2. Specify a service, for example https://localhost:8000.

  3. Under Additional application settings, specify any parameters you would like to add to your tunnel configuration.

  4. Select Save tunnel.

インターネット上のすべてのユーザーが、このアプリケーションにパブリックホスト名を介して接続できるようになりました。モジュール4: アプリケーションのセキュリティでは、認可されたユーザーへのアクセスを制限する方法について説明します。

追加リソース

トンネルを通るトラフィックのルーティングをより制御するには、以下のリンクを参照してください: