DEV Community

olawole abdul-lateef
olawole abdul-lateef

Posted on

Configuring NGINX

Introduction
In the world of DevOps, mastering the basics of web server configuration is a fundamental skill. As part of the DevOps training, I set up and configure NGINX on a fresh Ubuntu server. This task was designed to test the ability to work with basic web server configurations and deliver a functional web server. The goal was to install NGINX, configure it to serve a custom HTML page, and document the entire process. This blog post details my approach, challenges, and learnings from this task.

Approach
Setting Up the Ubuntu Server:

  • I provisioned a Ubuntu server on a cloud platform (I used AWS EC2 for this task).

Image description

  • I ensured the server had a public IP address and allowed inbound traffic on port 22 (SSH) and port 80 (HTTP).
    Installing NGINX

  • I connected to the server via SSH using the ssh key generated and updated the package list using .sudo apt update

Image description

  • I installed NGINX using the command sudo apt install nginx -y.

Image description

  • After installation, I verified that NGINX was running using sudo systemctl status nginx.

Image description

Configuring the Custom HTML Page

  • I edited the default NGINX HTML file located at /var/www/html/index.html using the nano text editor. i replaced the default content with my desire text.

Image description

  • After saving the changes with control X, I restarted NGINX using sudo systemctl restart nginx to apply the new configuration.

Testing the Configuration:

I opened my browser and navigated to http://3.235.74.74 (my ubuntu server public ip) The custom HTML page was successfully displayed.

Image description

thanks

Do your career a big favor. Join DEV. (The website you're on right now)

It takes one minute, it's free, and is worth it for your career.

Get started

Community matters

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

👋 Kindness is contagious

Explore a sea of insights with this enlightening post, highly esteemed within the nurturing DEV Community. Coders of all stripes are invited to participate and contribute to our shared knowledge.

Expressing gratitude with a simple "thank you" can make a big impact. Leave your thanks in the comments!

On DEV, exchanging ideas smooths our way and strengthens our community bonds. Found this useful? A quick note of thanks to the author can mean a lot.

Okay