[Dev] プロキシサーバー再構築。コンテナにcertbotをインストール

in japanese •  4 days ago  (edited)

こんにちは、@yasuです。

設定をいじっていたら、プロキシサーバーの設定を壊してしまった。(起動しなくなった)

それで、過去の記事を参考にしながら、再構築しました。

無事に復旧しました。

他にもいろいろ手順がありますが、

メモを残しておきます。

docker exec -it proxy_proxy_1 bash
apt update
apt install python3-certbot-nginx
certbot --nginx -d steememory.com -d api.steememory.com

proxy_proxy_1はコンテナ名(実際の環境に合わせる)

以下のファイルを準備しておく。
default.conf をコピーして、server_nameを修正(ポート80のままで良い)
steememory.com.conf
api.steememory.com.conf

以下のコマンドで、confファイルの内容が自動的にSSL対応になる。
certbot --nginx -d steememory.com -d api.steememory.com

コンテナはコミットする。
docker commit コンテナID リポジトリ名:タグ名

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!