3
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

さくらのクラウドの AppRun共用型 はコンテナイメージを簡単にデプロイできるサービスです!
インフラの管理コストを削減でき、リクエストのない時はゼロスケールして料金が発生しないので気軽に利用できます。

アプリケーションを作成すると以下のような公開URLが発行されますが、独自ドメインを設定する機能はありません。

$ curl https://app-<application_id>.ingress.apprun.sakura.ne.jp
Hello from AppRun!

この記事では さくらのウェブアクセラレータ を使って、独自ドメインでアプリケーションにアクセスする方法を紹介します

$ curl http://hello.example.com
Hello from AppRun!

前提と事前準備

ドメインは さくらのドメインexample.com を取得している例で紹介します

AppRun共用型のアプリケーション作成方法は以下の記事を参考にしてください

ウェブアクセラレータでサイトの作成

まずはウェブアクセラレータのコントロールパネルから、サイトの新規作成を行います
https://secure.sakura.ad.jp/webaccel/#/regist

  • ドメイン種別:独自ドメイン
  • サイトのタイトル:hello
  • 公開ドメイン名:hello.example.com
  • オリジン種別:ウェブサーバ
  • オリジンプロトコル:https
  • オリジンサーバ:app-<application_id>.ingress.apprun.sakura.ne.jp

image.png

作成するとCNAMEのレコードが発行されます

image.png

ドメインにCNAMEを登録

さくらのドメインのコントロールパネルから、ドメインのゾーン情報にCNAMEを追加します
https://secure.sakura.ad.jp/domain/domains

image.png

サイトの有効化とSSL対応

ウェブアクセラレータのコントロールパネルから、サイトを有効にします

image.png

反映されるまでしばらく時間がかかりますが、以下のような結果になればOKです

$ host hello.example.com
hello.example.com is an alias for ***.user.webaccel.jp.
...

Let's Encryptの証明書を発行してSSL対応も簡単にできます(こちらも反映に時間がかかる)

image.png

動作確認

独自ドメインからアプリケーションにリクエストが送れたら完了です!

$ curl http://hello.example.com
Hello from AppRun!
3
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?