フロントエンドアプリケーションHTTPS(feat.certbot,nginx)の導入
Environment
sudo su
)が使用されます.1.nginx&certbotのインストール
apt-get update
apt-get install nginx
apt-get install software-properties-common
add-apt-repository ppa:certbot/certbot
apt-get update
2.Pythonのインストール
この段階では、Pythonがインストールされている可能性があります.
python --version
apt-get install python
apt-get install python-certbot-nginx
apt-get install python-certbot3-nginx
3.構築反応
gitをインストールし、コードを取得します.もうあるならスキップして
apt-get install git
git config --global user.name i4song
git config --global user.email [email protected]
git clone https://github.com/i4song/i4song-blog.git
apt-get install -y build-essential
apt-get install curl
curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash --
apt-get install -y node.js
apt-get install npm
npm install -g yarn
cd i4song-blog
yarn
or npm install
yarn run build
or npm run build
4.nginx(for react)の設定
ドメイン名を使用してconfigファイルを作成し、シンボルリンクを作成します.
vi /etc/nginx/sites-available/i4song.com
server {
server_name i4song.com;
location / {
root /home/i4song/i4song-blog/build/; //리액트 프로젝트의 build 폴더 위치
index index.html;
try_files $uri $uri/ /index.html;
}
}
sudo ln -s /etc/nginx/sites-available/i4song.com /etc/nginx/sites-enabled/i4song.com
4.certbotを使用して証明書を発行する
certbot --nginx -d i4song.com
5.証明書自動更新の設定(crontab)
設定:証明書を毎月更新します.
crontab -e
1 1 1 * * certbot renew --renew-hook "sudo service nginx restart"
Reference
この問題について(フロントエンドアプリケーションHTTPS(feat.certbot,nginx)の導入), 我々は、より多くの情報をここで見つけました https://velog.io/@dnr6054/react-https-applicationテキストは自由に共有またはコピーできます。ただし、このドキュメントのURLは参考URLとして残しておいてください。
Collection and Share based on the CC Protocol