Deploy-react-app-on-AWS-EC2
EC2 上部署 React APP
sudo apt-get update && sudo apt-get upgrade -y
sudo apt-get install nginx -y
sudo systemctl start nginx
sudo systemctl enable nginx
sudo apt-get install build-essential libssl-dev
-
cd ~ curl -sL https://raw.githubusercontent.com/creationix/nvm/v0.33.6/install.sh -o install_nvm.sh bash install_nvm.sh source ~/.profile nvm install 8.15.0 nvm use 8.15.0
sudo vim /etc/nginx/sites-available/default
- in server block
location / { root /home/ubuntu/myReactApp/build; index index.html index.htm index.nginx-debian.html; }
sudo service nginx restart