- Setup ec2 instance by selecting os image and instance type
sudo git clone <user repo link>
sudo cp -a /home/ubuntu/<your folder name>/www/* /var/www/html/
- Add same rule shown in the image
sudo apt install nginx
sudo nano /etc/nginx/sites-available/default
-
Add the following to the location part of the server block
server { listen 80 default_server; listen [::]:80 default_server; root /var/www/html; index index.html ; server_name _; location / { try_files $uri $uri/ /index.html =404; }
sudo nginx -t
sudo systemctl restart nginx
sudo nano /etc/nginx/sites-enabled/default
-
Again restart nginx
sudo systemctl restart nginx
sudo systemctl status nginx