Practice Exercise 5: Nginx
Objectives
To run a simple webserver using nginx
Tasks
- Install nginx on the
web1
instancesudo dnf install nginx
- Start the nginx service:
sudo systemctl start nginx
- Create a simple HTML page:
Nginx has a default
sudo vim /usr/share/nginx/html/index.html
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>
- 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.