サイトのトップへ戻る

Google App Engine ドキュメント日本語訳

カスタムドメインを使用する

Google App Engineを使用したアプリケーションを作成する場合、アプリは自動的にyour-app-ID.appspot.comappspot.com ドメイン上で提供されます。 しかし、アプリケーションをあなたが所有するカスタムドメイン(example.com)や、そのドメインの特定のサブドメイン(app.example.com)や、 そのサブドメインの任意もしくは全てのサブドメイン(*.example.com)で提供するのが 望ましいことがしばしばあります。

App Engineでこれを行うのは簡単です。もちろん、まずはドメイン登録業者(ドメインレジストラ)を通じてドメインを取得しなければなりません。 ドメインを取得したら、アプリをカスタマイズしてドメインやサブドメインを使えるようにするために3ステップが必要です。:

  1. Googleに対して、あなたがこのドメインの所有者であることを証明します。
  2. Google サーバを設定してドメインを認識させます。
  3. Google サーバを参照するように、あなたのドメイン登録業者のDNSレコードを更新します。

全ての処理は、通常はあなたのコンピュータで数分で完了できます。

このページの説明は、通常のHTTP接続を使いなおかつGoogle Appsを通じて提供されていないApp Engineアプリに対してのものなので注意してください。 Here are some related procedures that require different instructions:

  • Google Appsを通じてあなたのApp Engineアプリを提供するには、Google Apps ヘルプセンターでApp Engineについて読んでください。
  • Google Apps サービスに追加ドメインを割り当てるには、Google Apps ヘルプセンターでカスタムドメインについて読んでください。
  • App Engine アプリにセキュアソケットレイヤー(SSL)暗号化(すなわち、HTTPS アドレス)を追加するには、Google Appsで提供されるSSLサービスを使用する必要があります。 カスタムドメインのSSLのページに情報と手順が載っています。


カスタムドメイン上でアプリを提供する

使用するドメインの準備できていない場合は、ドメイン登録業者から一つ購入してください。 ("ドメイン登録業者"で検索すると何社か出てきます。) それから、あなたのアプリケーションをドメインに関連付けるには以下のボタンをクリックしてください。

プロジェクトを選んでそれをドメインに関連付ける

次のページでは、あなたがドメインの所有権であることを確認する必要があります。. それから、App Engineアプリを提供するのに使用したいドメインを選んでください。 最後に、開発者コンソールで一覧表示された A, AAAA, CNAME レコードをあなたのドメイン登録業者に追加します。

ドメインレコードの更新はインターネット上に伝播するまでに時間がかかり、ユーザーごとに伝わる時間が異なります。 この処理は最大で二日かかりますが、ほとんどのユーザーの場合はそれよりも速く伝わります。 ドメイン登録業者がそうした変更を実装しているか確認したい場合は、 dignslookupのようなDNS ツールを使用できます。

カスタムドメインで Strict-Transport-Security ヘッダを使用する

あなたのドメインがホワイトリストに登録されていなければ、Strict-Transport-Security ヘッダを使用することができません。 あなたのドメインをホワイトリストに登録するには、agl@chromium.orgへ連絡してください。



サブドメイン

カスタムドメインにワイルドカードサブドメインマッピングを設定している場合、あなたのアプリケーションは合致する全てのサブドメインへ対するリクエストを処理します。

If the user browses a domain that matches an application version name or module name, the application serves that version. If the user browses a domain that matches a module name, the application serves that module. 例えば、あなたがワイルドカードサブドメイン *.wild.example.comを設定したとします。 Your application has two versions, the default version and one named beta, and a module named be with just one module instance running.

  • whatever.wild.example.com ではアプリケーションが提供されます。
  • beta.wild.example.com ではアプリケーションの ベータ版が提供されます。
  • alpha.beta.wild.example.com でも アプリケーションの ベータ版が提供されます。
  • be.wild.example.com では be モジュールが提供されます。
  • 0.be.wild.example.com では be モジュールの0インスタンスが提供されます。
  • something.0.be.wild.example.com でも be モジュールの0インスタンスが提供されます。
  • 1.be.wild.example.com serves an error message, but if the be module was provisioned with more than one instance, then this would serve the first (after zeroth) instance.

You can use wildcards to map subdomains at any level, starting at third-level subdomains. For example, if your domain is example.com and you enter text in the web address field:

* と入力すると、あなたのアプリのexample.comの全てのサブドメインに紐付けられます。

*.private と入力すると、あなたのアプリのprivate.example.comの全てのサブドメインに紐付けられます。

*.nichol.sharks.nhl と入力すると、あなたのアプリのnichol.sharks.nhl.example.comの全てのサブドメインに紐付けられます。

*.excogitate.system と入力すると、あなたのアプリのexcogitate.system.example.comの全てのサブドメインに紐付けられます。

If you use Google Apps with other subdomains on your domain, such as sites and mail, those mappings have higher priority and are matched first, before any wildcard mapping takes place. In addition, if you have other App Engine apps mapped to other subdomains, those mappings also have higher priority than any wildcard mapping.

いくつかのDNSプロバイダではワイルドカードサブドメインの紐付けが動作しないことがあるので注意してください。 In particular, a DNS provider must permit wildcards in CNAME host entries.