Skip to content

Instantly share code, notes, and snippets.

@dhairya137
Last active May 19, 2021 14:13
Show Gist options
  • Save dhairya137/591ee114b2d79c21a88d180551e7a8b4 to your computer and use it in GitHub Desktop.
Save dhairya137/591ee114b2d79c21a88d180551e7a8b4 to your computer and use it in GitHub Desktop.
React app installation and configuration with nginx to create AMI
Step 1 - Install nvm(or node directly), Nginx (for nginx refer this -> https://www.digitalocean.com/community/tutorials/how-to-install-nginx-on-ubuntu-20-04)
Step 2 - Create react app
Step 3 - Build react app
Step 4 - Configure Nginx to the react build folder
Nginx configuration
-> cd /etc/nginx/sites-available/ (it has default file)
-> sudo nano default
-> change 'root /var/www/html/' to 'root /home/ubuntu/yourapp/build' (Change to your own react build folder)
Step 5 - After nginx configuration restart nginx (sudo systemctl restart nginx)
My AWS AMI -> ami-0e226b508cc8fbdc3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment