0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

AWS 上の ALB の HealthChecker に 200 を返す方法

Last updated at Posted at 2020-05-31

AWS 上の ALB のターゲットの Moodle で HealthChecker に認識させることはできないのは、config.php が読み込んでいる lib/setuplib.php でリダイレクトしているからで、ターゲットでは 303 になりうまくいきません。
config.php の最上部で、以下のように記述すれば、200 を返す事ができます。
コツは、lib/setuplib.php を読み込む前に処理を入れることです。

$http_user_agent = $_SERVER['HTTP_USER_AGENT'];
if (strstr($http_user_agent, "ELB-HealthChecker")) {
    echo "ok";
    die;
}
0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?