Skip to main content

Nginx And The LEMP Stack


Intro Video

Photo of Terrence Cox

Terrence Cox

Senior Vice President of Content

A veteran of twenty years in Information Technology in a variety of roles. He has worked in development, security and infrastructure well before they merged into what we now call DevOps. He provides training in Linux, VMWare, DevOps (Ansible, Jenkins, etc) as well as containers and AWS topics. He now leads the Training Architects to produce the courses and content we all know and love!







Course Details

This video course will serve as an introduction to the Nginx Web Server and will help point out key differences between Nginx and Apache. Our exploration will serve both as a setup exercise as well as a detailed configuration guide. We will deploy and setup Nginx Web Server from scratch and then conceptually build a fully functional LEMP server as we learn each new directive and configuration topic.


Introduction and Installation



Lesson Description:

This video will introduce the Nginx web server and delineate how it is different in architecture, configuration and style from its more popular cousin, Apache HTTP Server.

Installation and Basic Setup Tour


Lesson Description:

This video will demonstrate how to add the appropriate repository to CentOS and then the process as it applies to almost any distribution for the initial installation and service start of Nginx. Finally, we will take a brief tour of the important file and directory locations for the server.

VHosts and Directives

Standard Configuration


Lesson Description:

We will take our basic installation and setup from earlier in our series, and make some adjustments that make sense in a server environment. We will talk about how to make the configuration directories more familiar to those used to managing Apache without compromising what makes Nginx great. We will then test and restart our server to be sure we are ready to proceed.

Vhost Files


Lesson Description:

Now we begin to dive into the deep end. Much like Apache, we will show how to allow our web server to answer for various domains by configuring them in Vhost files (Virtual Hosts). We will talk about the default method in the nginx.conf file, but then move to the more common externalization of those files and how to set them up to answer for our configured domains and file system locations.

Upstream Directive


Lesson Description:

Now that we have our Vhost configurations set up for basic domain management, we will learn about how the Upstream directive in our Vhosts can allow us to do port redirection. We will add a server configuration name and then reference it within our server configuration. NOTE: Source for simple HTTP server used in this video can be obtained from here:

Basic Load Balancing


Lesson Description:

Our Upstream directive showed us how to manage server resources by name and port, now we will use that directive to manage multiple nodes. This will allow Nginx to proxy connections to multiple back ends and then balance the load amongst them using weighting to determine which servers get the most connections.

SSL Certificate Management


Lesson Description:

Up to now, we have been listening to incoming connections over standard, unsecured HTTP. In this video, we will talk about securing our traffic over HTTPS and demonstrate how to generate our server key, the certificate signing request (for exchange with a third party for a valid certificate) and how to self sign a certificate for non-production or test environments. Finally, we will add that functionality to our configured Vhost domain and test that the connection shows as secured.

Location Directive


Lesson Description:

In this video we will explore the Location directive. We will talk about its purpose, how it differentiates a location from the root directive and customizing it to give us flexibility in traffic management and page requests.

Return Directive


Lesson Description:

Within our web configuration, we have the ability to specifically indicate how Nginx should respond to certain page or path requests. In this video, we will demonstrate how to use the return directive to customize how our server responds to certain requests.

Basic Rewrites


Lesson Description:

Although we could spend a full course of videos on how to do regular expression matching, this video will introduce you to the ability to use said regular expressions to rewrite paths or results automatically in your configuration. We will talk about how it works and the format to use in your rewrite statement.

Custom Error Pages


Lesson Description:

Like almost everything else in our Nginx configuration, we can take full control over how our web server responds to pages and requests. This video will show how to replace the built in error pages (like 403, 404, 50x) with custom error pages that can be built to match your domain and branding.


Logging Directives


Lesson Description:

This video will introduce the viewer to the myriad of logging directives available globally as well as how to override those by domain and/or by service in our vhost configurations.

Custom Log Levels


Lesson Description:

Now that we know how to set global and domain/service log file locations, we will talk about performance (buffering) and log levels for our error reporting and what each level means.

Custom Access Log Format


Lesson Description:

We have control over the details of many aspects of our Nginx web server, including how access logs are written and in what format. In this video we will demonstrate how to create multiple log_formats that we can use in various situations and how to use them to write only the information useful to us.


Blocking IPs


Lesson Description:

Although we can talk about how to Block IPs at a firewall level (whether it is a hardware firewall device or a software level firewall on our system), sometimes we want to allow the connections and have more granular control over how and why we block them. We will set up a basic set of ACLs at a Web Server and then domain level and how each one works.

LEMP Stack

LEMP Stack: Configuration Optimization


Lesson Description:

This video will talk about how to optimize our setup so we can configure our new LEMP stack Web, PHP and MariaDB system.



Lesson Description:

This video will leverage our Nginx setup and install and configure PHP and the necessary PHP-FPM module for use in our Web/DB/PHP environment.

LEMP Stack: MariaDB


Lesson Description:

This video will leverage our Nginx setup and install and configure MariaDB (the drop in MySQL replacement DB) and the necessary secure setup for use in our Web/DB/PHP environment.




Lesson Description:

We will try to wrap up the course and discuss all the use cases for Nginx in general.

Take this course and learn a new skill today.

Transform your learning with our all access plan.

Start 7-Day Free Trial