Chapter

Getting started

What nginx is, how a web request works, and how to install, run, and serve your first page.

Nginx Basics 6 Lessons from courses

About this chapter

This chapter gets nginx onto your machine and running. You will learn what nginx actually does, follow a web request from the browser to the server and back, install nginx on Linux, control it with start/stop/reload, and edit its default page to see a real change.

Lessons from courses

  1. 1 What is nginx? What is nginx? A fast web server and reverse proxy in plain terms - what it does, where it runs, and why so many sites use it.
  2. 2 How a web request works How a web request works: the client-server request and response cycle behind every website, and the HTTP mental model you need before nginx.
  3. 3 Nginx vs Apache Nginx vs Apache for beginners: event-driven vs process-per-request, static file speed, memory use, and when to pick each web server.
  4. 4 Installing nginx Install nginx on Ubuntu or Debian with apt, plus Docker and WSL notes for Windows and Mac. Verify the install works in your browser.
  5. 5 Start, stop, and reload nginx Start, stop, and reload nginx with systemctl and nginx -s, check status, and learn the difference between reload and restart without downtime.
  6. 6 Your first page Edit the default nginx page: find the web root in /var/www/html, change index.html, and see your first nginx page live in the browser.
Nginx Basics Go to course