LoginSignup
6
4

More than 5 years have passed since last update.

Let's encrypt で 一時ファイルが作成できない時の対策

Last updated at Posted at 2018-03-13

Let's Encrypt ユーザーガイド
上記に次の記述があります。

Webroot プラグインは ${webroot-path}/.well-known/acme-challenge に一時ファイル(ワンタイムトークン)
を作成し、Let's Encrypt の認証サーバから HTTP リクエスト(名前解決には DNS のAレコードを使用)
で取得することにより、認証を行います。
もし、ウェブサーバの設定によって /.well-known に対して特別な扱いがされている場合には、
/.well-known/acme-challenge 内のファイルに外部からアクセス可能にするために
設定を変更する必要があるかもしれません。

/.well-known/acme-challenge にアクセスできるようにするには、

nginx.conf に

location ^~ /.well-known/acme-challenge/ {
     default_type "text/plain";
}

を加えます。

nginx.conf が正しいか確認

sudo nginx -t

Nginx の再起動

sudo systemctl restart nginx

上記は、CentOS 7 で確認しました。

次の記述は誤りです。

2018年3月以降のLet's Encrypt の証明書は、一時ファイルとして
/.well-known/acme-challenge
を使いません。

6
4
3

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
6
4