Introduction to NGINX

Introduction to NGINX

English | MP4 | AVC 1280×720 | AAC 44KHz 2ch | 52 lectures (6h 40m) | 2.91 GB

Understand and Deploy Layer 4/Layer 7 Load Balancing, WebSockets, HTTPS, HTTP/2, TLS 1.3 with NGINX (With Docker)

NGINX is an open-source web server written in C and can also be used as a reverse proxy and a load balancer. This class Is an introduction to NGINX, by the end of this class you will be able to understand the fundamentals of NGINX and spin up your own instance and even secure it with a legitimate certificate.

Here are the topics that I will discuss:

  • What is NGINX?
  • NGINX Use Cases
  • Layer 4 and Layer 7 Proxying in Nginx
  • NGINX Timoouts
  • Example
  • Install Nginx (mac)
  • Nginx as a Web Server
  • Static content
  • Regular expression in NGINX
  • proxy_pass
  • Nginx as a Layer 7 Proxy
  • Proxy to 4 backend NodeJS services (docker)
  • IP_Hash load balancing
  • Split load to multiple backends (app1/app2)
  • Block certain requests (/admin)
  • NGINX as a Layer 4 Proxy
  • Create DNS record
  • Enable HTTPS on NGINX (lets encrypt)
  • Enable TLS 1.3 on NGINX
  • Enable HTTP/2 on NGINX

A small blurb about NGINX

NGINX is one of a handful of servers written to address the C10K problem. Unlike traditional servers, NGINX doesn’t rely on threads to handle requests. Instead it uses a much more scalable event-driven (asynchronous) architecture. This architecture uses small, but more importantly, predictable amounts of memory under load. Even if you don’t expect to handle thousands of simultaneous requests, you can still benefit from NGINX’s high-performance and small memory footprint. NGINX scales in all directions: from the smallest VPS all the way up to large clusters of servers.

What you’ll learn

  • Layer 7 Load Balancing between services
  • Layer 4 Load Balancing between services
  • Setup NGINX as a Web Server
  • TLS Passthrough vs TLS Termination
  • Block Undesired Requests and Re-route requests to different services
  • Enable HTTPS with letsEncrypt
  • Enable HTTP/2 with NGINX
  • Enable TLS 1.3 with NGINX
  • NGINX Timeouts
  • Scaling WebSockets with NGINX
  • Load Balancing WebSockets with NGINX
Table of Contents

The Fundamentals of NGINX
Download Slides here
What is NGINX
NGINX Use Cases
Layer 4 and Layer 7 Load Balancing in NGINX
TLS Termination and TLS Passthrough
NGINX Internal Architecture
Threading and Connections
NGINX Threading Architecture

Running NGINX in Docker
What are we building
Download source code and config here
NGINX WebServer Container
Three Node app containers with NGINX in One Docker Network
Two NGINX containers load balancing to same backends
Docker networking

Understanding NGINX Timeouts for efficient configuration
NGINX Frontend Timeouts
NGINX Backend Timeouts

More NGINX Configurations
Read this before you continue with this section
Spin up lightweight Docker Container with your application nodeapp
Working with NGINX What will we do
Installing NGINX
NGINX as a Web Server
NGINX as a Layer 7 Proxy
NGINX as a Layer 4 Proxy
Enabling Fast and Secure TLS 13 on NGINX
Enable HTTP2 on NginX

Scaling WebSockets with NGINX
Download section slides code config and resources here
NGINX and WebSockets Agenda
Introduction to WebSockets
Layer 4 vs Layer 7 WebSockets Proxying
Spin up a WebSockets Server
Configure NGINX as Layer 4 WebSocket Proxying
Configure NGINX as Layer 7 WebSocket Proxying
Section Summary

Answering your Questions
How to Scale NGINX
How many Backends do we need for NGINX

Bonus Content
NGINRat a remote access trojan injecting NGINX article
Bonus Proxy vs Reverse Proxy
NGINX Process Architecture
Course Summary