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

Top comments (0)