Core Foundations
This module builds the mental model you need before touching any configuration. Understanding how Nginx works internally makes every later decision — server blocks, locations, PHP-FPM, reverse proxy — make immediate sense.
Why Start Here
Many Nginx problems (502 errors, permission issues, config not applying) trace back to a weak mental model. Know the process architecture and file layout first.
What You Will Learn
- What Nginx is and when to choose it over Apache or OpenLiteSpeed
- How the master/worker process model works
- How to install Nginx on Ubuntu/Debian and RHEL-family systems
- Where every important file lives under
/etc/nginx/ - How to validate config, reload, and restart safely from the CLI
Topics in This Module
- What is Nginx — Use cases, comparison with alternatives, strengths and limits
- Process Architecture — Master/worker model, event loop, connection handling
- Installation — Full install commands for Debian and RHEL families, post-install verification
- Directory Structure — Every path under
/etc/nginx/and/var/log/nginx/explained - Configuration Syntax — Contexts, blocks, directives, inheritance rules
Best Practices
- Always run
sudo nginx -tbefore reloading — it validates syntax without disrupting traffic - Use
conf.d/orsites-available/+sites-enabled/symlinks for per-site organization - Know the difference between
reload(graceful, no downtime) andrestart(drops connections) - Read
/var/log/nginx/error.logfirst when anything goes wrong
Success Checkpoint
By the end of this module you should be able to explain what the Nginx master process does, where configs live, how to test config syntax, and how to apply changes without dropping connections.