Tech

EC2(スポットインスタンス)で運用の WordPress が 504 ERROR

EC2(スポットインスタンス)で運用の WordPress が 504 ERROR

AWSのEC2スポットインスタンスでWordPressサイトを運用して

サイトを確認したら504 ERRORになってた。。

504 ERROR
The request could not be satisfied.
CloudFront attempted to establish a connection with the origin, but either the attempt failed or the origin closed the connection. We can't connect to the server for this app or website at this time. There might be too much traffic or a configuration error. Try again later, or contact the app or website owner.
If you provide content to customers through CloudFront, you can find steps to troubleshoot and help prevent this error by reviewing the CloudFront documentation.
Generated by cloudfront (CloudFront)
Request ID:xxxxxx

CloudFrontでoriginが参照できてないようなので、AWSのコンソールで確認。なぜかインスタンスのスポットリクエストの状態が cancelled に。

さらに確認したところリクエストの有効期間の終了が数日前の日にちに。。

有効期間の終了を設定した覚えはないが、有効期間の開始がちょうど1年前になっていたので、初期設定で入っていた、んですかね。

仕方がない、というか、どうしようもないので、取得していたAMIからスポットリクエストを実施し、CloudFrontのoriginを変更して復旧。

有効期限の開始も終了も未設定なことを確認。