DEV Community

Cover image for Deploying My First Web Server with Nginx
Beny
Beny

Posted on

Deploying My First Web Server with Nginx

Today I worked on a simple but important DevOps task: deploying a web server using Nginx on Ubuntu.

Instead of only learning the theory, I wanted to understand the practical flow of how a web server receives a request and serves a webpage.

What I Did

  • Installed and verified Nginx
  • Started the Nginx service
  • Checked the server status
  • Tested the server using curl
  • Created a custom HTML webpage
  • Served the webpage through Nginx
  • Accessed the webpage using http://localhost

Simple Architecture

Browser
   ↓
HTTP Request
   ↓
Nginx Web Server
   ↓
/var/www/html/index.html
   ↓
HTML Response
   ↓
Webpage
Enter fullscreen mode Exit fullscreen mode

Commands I Used

nginx -v

sudo service nginx start

sudo service nginx status

curl http://localhost

sudo nginx -t

sudo service nginx reload
Enter fullscreen mode Exit fullscreen mode

What I Built

For the practical demonstration, I created a simple web page and served it using Nginx.

The page was placed in:

/var/www/html/index.html
Enter fullscreen mode Exit fullscreen mode

After configuring the page, I verified the Nginx configuration and accessed it through:

http://localhost
Enter fullscreen mode Exit fullscreen mode

What I Learned 💡

This task helped me understand that deploying a webpage involves more than just writing HTML.

The basic flow is:

Browser → HTTP Request → Nginx → HTML File → Response

I also got practical experience with Linux services, Nginx configuration, the web root directory, and testing a web server from the terminal.

Key Takeaway

A simple Nginx deployment gave me a better understanding of the infrastructure layer behind web applications.

Next, I want to explore how Nginx can be used as a reverse proxy for backend applications. 🚀

#Nginx #DevOps #WebServer #Linux #Ubuntu #CloudComputing #BackendDevelopment #WebDevelopment #SoftwareEngineering

Top comments (0)