Kodecloud Day 26: Configuring an EC2 Instance as a Web Server with Nginx
Requirement is to configure an EC2 instance which automatically install and start the Nginx server.
Kodecloud Day 26: Configuring an EC2 Instance as a Web Server with Nginx
Requirement is to configure an EC2 instance which automatically install and start the Nginx server.
Steps:
Step 1 : Create a Security group
Inbound rules : HTTP port 80–0.0.0.0/0
ssh port 22–0.0.0.0/0

Step 2 :
Configure an Ec2 instance with a provided name.
Choose ubuntu AMI ,
t2/t3 micro ,
attach the created security group.
Now click advanced settings -> scroll down to the bottom.
USER Data : (Paste the below mentioned script)
!/bin/bash
apt update -y apt install nginx -y systemctl start nginx systemctl enable nginx
The above script says that it should Install and start the nginx server when we launch the ec2 instance.

CLICK LAUNCH INSTANCE .
Now put this is the browser http:// public ip address

메타데이터
- post_id
- ec41191f3ef5
- slug
- kodecloud-day-26-configuring-an-ec2-instance-as-a-web-server-with-nginx-ec41191f3ef5
- url
- https://medium.com/@mbmani66/kodecloud-day-26-configuring-an-ec2-instance-as-a-web-server-with-nginx-ec41191f3ef5
- canonical_url
- https://medium.com/@mbmani66/kodecloud-day-26-configuring-an-ec2-instance-as-a-web-server-with-nginx-ec41191f3ef5
- author_url
- https://medium.com/@mbmani66
- status
- ok
- fetched_at
- 2026-06-09 15:37:30