Health Checks on AWS ALB when URL is https - Ghost
AWS ECS x Ghost
Ghost - ビジネス用のブランドブログの作成に特化したCMS
Ghost: Turn your audience into a business
The world’s most popular modern publishing platform for creating a new media platform. Used by Apple, SkyNews, Buffer, OpenAI, and thousands more.

GhostのConfiguration optionsでURLのプロトコルにhttpsを設定するとhttpのリクエストはhttpsへリダイレクトする。
> curl -v http://GHOST.TASK.PUBLICK.IP:2368/ghost/api/v3/admin/site/
HTTP/1.1 301 Moved Permanently
...
Location: https://GHOST.TASK.PUBLICK.IP:2368/ghost/api/v3/admin/site/
...
ALB経由でGhostのTaskにリクエストする場合、ターゲットグループのHealth ChecksではSuccess Code(ステータスコード)が200に設定されているので、失敗してしまう。Target GroupのHealth checksのSuccess Codesをリダイレクトステータスコード 301に変更することで、Health Checkが成功するため、Taskが正常に起動する。
他の案として
HeaderにX-Forwarded-Proto: https を追加することでレスポンスでステータスコードに200が返ってくるケースもあるが、Health Checksのヘッダーに追加することができないので見送り
[features] A health check endpoint · Issue #11181 · TryGhost/Ghost
Could we please add a simple health api in index.js? It will serve our needs for load balancers (GCP for us), site reliability monitoring. I am creating a PR for it but seeking for your advice in a...