前提・実現したいこと
現在こちらの記事を参考に、AWS:EC2上のDjangoアプリを独自ドメイン、SSL対応させようとしています。
ドメインはお名前.comで取得、Route53でDNSの設定をし、http://ドメイン名/admin
でDjangoで管理画面が出るのでDNS設定はうまくいっていると思います。
その後、SSL化をcertbotで行おうとした際にエラーが発生しました。
発生している問題・エラーメッセージ
certbot公式でNginx、Ubuntu20を選択し手順通りに進め、
sudo certbot --nginx
で証明書の取得と、Nginxの編集を行おうとしたところ、
sudo certbot --nginx Saving debug log to /var/log/letsencrypt/letsencrypt.log Which names would you like to activate HTTPS for? - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1: pmakeh.com - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Select the appropriate numbers separated by commas and/or spaces, or leave input blank to select all options shown (Enter 'c' to cancel): 1 Requesting a certificate for pmakeh.com Certbot failed to authenticate some domains (authenticator: nginx). The Certificate Authority reported these problems: Domain: pmakeh.com Type: connection Detail: Fetching http://pmakeh.com/.well-known/acme-challenge/rhmiRk9Ng6Y7UCYLvrFtxZqR64aGe3Of7tQK9fofjxs: Timeout during connect (likely firewall problem) Hint: The Certificate Authority failed to verify the temporary nginx configuration changes made by Certbot. Ensure the listed domains point to this nginx server and that it is accessible from the internet. Some challenges have failed. Ask for help or search for solutions at https://community.letsencrypt.org. See the logfile /var/log/letsencrypt/letsencrypt.log or re-run Certbot with -v for more details.
というエラーがでてきました。
試したこと
Nginx側ではserver_nameがpmakeh.comとなっていることが確認できました。
listen 80 server_name pmakeh.com;
また、EC2内のサーバー側も、80と443ポートが解放されていることを確認しました。
一点疑問に思うことが、ブラウザ上でhttp://IPアドレス/admin
と打つと、404 Not Foundの表示が出ます。
これは、Nginx側のserver_nameにIPアドレスがないからだと思うのですが、証明書発行の際にはIPアドレスもserver_nameの欄に記入しないといけないなどの決まりがあるのではと、疑問に思いました。
初歩的ですが、エラー解決にご協力いただけると幸いです
補足情報(FW/ツールのバージョンなど)
EC2: Ubuntu20.04
Nginx: 1.18.0
Nginx、gunicornともsystemctl statusコマンドで起動は確認済みです。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2022/02/09 09:14
2022/02/09 10:22