Skip to content

deploy 中にメンテナンスページを表示する仕組みがほしい #2

Closed

Description

@naokazuterada

背景

rsync で deploy 中、ファイルが書き換わっている最中にアクセスがあると、PHP サイトでは 500 エラーが返ったり、静的サイトでも新旧ファイルが混在して表示が崩れることがあります。利用者には何が起きているかわかりにくい状態になります。

要望

deploy の開始時に「メンテナンス中」を示すページを表示し、完了時に自動で解除する仕組みがほしいです。WordPress に限らず汎用的に使える形だと嬉しいです。

想定する実装

  • before_sync でメンテナンスモードを有効化(例: .htaccess の RewriteRule で全リクエストを maintenance.html にリダイレクト)
  • after_sync でメンテナンスモードを解除
  • メンテナンスページ本体(maintenance.html)はプロジェクト側で用意できると柔軟

参考

  • niwa-archives.org の deploy で実際に 500 が発生して相談されたケース

Activity

  1. naokazuterada commented on Jun 23, 2026

    @naokazuterada
    MemberAuthor

    #3 で実装

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions