Table of Contents

Nginx

Nginx is a high-performance web server that can also function as a reverse proxy, load balancer, and HTTP cache. This guide demonstrates how to configure Nginx for reverse proxying and load balancing using Docker containers.

What is a Reverse Proxy?

A reverse proxy sits between clients and backend servers, forwarding client requests to the appropriate backend server and then returning the server's response back to the client. Benefits include:

  • Load distribution - Spread requests across multiple servers
  • SSL termination - Handle SSL/TLS encryption/decryption
  • Caching - Store frequently requested content
  • Security - Hide backend server details from clients
  • Compression - Reduce bandwidth usage

In This Section

  • Reverse Proxy — Configuring Nginx as a reverse proxy with Docker — basic setup, separate ports, and name-based virtual hosts
  • Load Balancing — Load balancing with Nginx — upstream groups, balancing methods, health checks, and advanced configuration
  • TLS / Let's Encrypt — Configuring TLS/SSL in Nginx, including automated certificates with Let's Encrypt (Certbot) on host and in Docker
  • Monitoring & Troubleshooting — Monitoring Nginx with the status module, useful operational commands, and solutions to common issues
  • Best Practices — Nginx security headers, rate limiting, and caching best practices

Resources

Header reference: