Skip to content

Practice Exercise 5: Nginx

Objectives

To run a simple webserver using nginx

Tasks

  • Install nginx on the web1 instance
    sudo dnf install nginx
    
  • Start the nginx service:
    sudo systemctl start nginx
    
  • Create a simple HTML page:
    sudo vim /usr/share/nginx/html/index.html
    
    Nginx has a default index.html, proceed to delete the content and replace it with code such as the one provided below, feel free to customize your code.
<!DOCTYPE html>
<html>
<body>

<h1>Academy Batch 5</h1>

<p>Welcome to my first Nginx server!</p>

</body>
</html>
  1. Open a web browser and visit your host .a1t-inf-ds-web1.acad.opswerks.net

Conclusion

This exercise helped you gain practical experience in setting up a basic web server using Nginx, which can be a foundational skill for hosting websites, web applications, and various web services. Understanding Nginx is valuable for managing web infrastructure and serving web content to users.