Hosting a website on AWS EC2 instance using the nginx web server.
Nginx is a high-performance HTTP server, reverse proxy server, and an IMAP/POP3 proxy server. It is known for its stability, rich feature set, simple configuration, and low resource consumption.
Prerequisites :
AWS Account with EC2 Instance
Here's how to install and configure Nginx on an Ubuntu system.
Step 1: launch and connect to an instance.
Step 2: First, update your package lists to ensure you get the latest version and dependencies:
Sudo apt-get update
Step 3: Install nginx.
Install Nginx using the package manager.
Sudo apt-get install nginx
Step 4: Start and Enable Nginx
Start the Nginx service
Sudo systemctl restart nginx
Sudo systemctl enable nginx
Step 5: Verify Nginx Installation
To check if Nginx is running, you can use:
sudo systemctl status nginx
upload application code file.
Change application code in /var/ www/html/index.nginx-debian.html file.
check the webpage using public ip address. (http://Public-ip )
By above these steps, you will have a fully functional Nginx server on your Ubuntu system, ready to serve static or dynamic content, act as a reverse proxy, or perform other advanced tasks.
Happy Learning…!
