>_ IzzyLab

Hands-on task

This task is step 1 of the course “nginx basics”

Serve a page with nginx

medium~5 min

nginx is already installed in the sandbox but not running. Configure it to serve your own index.html with the text Hello from IzzyLab at http://localhost/. The page is easy to write in the Editor tab (the /var/www/html directory), and you can see the result in the Site tab.

What you'll practise:
  • nginx
  • apt
  • document root
  • index.html
  • service

Topic breakdown

A web server is a process that listens on a TCP port and, on an HTTP request, serves files from its directory (document root). Installing the package via a package manager (apt) and starting the daemon are separate steps: in a container without systemd, the service is brought up via service or by calling the binary directly. For the site to serve your content, you edit exactly the index.html that sits in the site root (/var/www/html) — otherwise you'll see the default placeholder.

What's checked

  1. nginx is running
  2. the page serves Hello from IzzyLab

What it looks like