DEV Community

Musungu (Ruth) Ambogo
Musungu (Ruth) Ambogo

Posted on

Setting Up Nginx: My First HNG12 Project

Introduction

NGINX is a web server, reverse proxy and load balancer used to server static content. The purpose of this task is to install and configure nginx on an Ubuntu server, which is the official stage 0 task of HNG 12 DevOps internship program

Setting up and configuration

  • Setting up the Ubuntu server: I first instantiated an EC2 instance on AWS. After setting it up, I enabled SSH access to connect to it remotely

Steps Taken:

  • Logged into my AWS Management Console.
  • Created a new EC2 instance running Ubuntu.
  • Configured security groups to allow SSH (port 22) and HTTP (port 80) access.
  • Downloaded the private key (.pem file) and connected to the instance using SSH.

  • Installing NGINX: Once inside the server, I installed NGINX using the following command:

bash
sudo apt update && sudo apt install -y nginx

Configuring NGINX to Serve a Web Page

By default, NGINX serves files from /var/www/html.

Challenges

  • While setting up the EC2 instance: I had to do lots of research since it was my first time
  • Using the Nano editor: For some reason, I couldn’t paste into the Nano editor. It took me some time to figure out the correct command.

Platform Engineers
Infrastructure Engineers

Hostinger image

Get n8n VPS hosting 3x cheaper than a cloud solution

Get fast, easy, secure n8n VPS hosting from $4.99/mo at Hostinger. Automate any workflow using a pre-installed n8n application and no-code customization.

Start now

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more