NGINX Cookbook

A practical book on real-world NGINX deployments to get you up and running quickly.

NGINX Cookbook

Tim Butler

1 customer reviews
A practical book on real-world NGINX deployments to get you up and running quickly.
Mapt Subscription
FREE
$29.99/m after trial
eBook
$25.20
RRP $35.99
Save 29%
Print + eBook
$44.99
RRP $44.99
What do I get with a Mapt Pro subscription?
  • Unlimited access to all Packt’s 5,000+ eBooks and Videos
  • Early Access content, Progress Tracking, and Assessments
  • 1 Free eBook or Video to download and keep every month after trial
What do I get with an eBook?
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with Print & eBook?
  • Get a paperback copy of the book delivered to you
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with a Video?
  • Download this Video course in MP4 format
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
$0.00
$25.20
$44.99
$29.99p/m after trial
RRP $35.99
RRP $44.99
Subscription
eBook
Print + eBook
Start 30 Day Trial
Subscribe and access every Packt eBook & Video.
 
  • 5,000+ eBooks & Videos
  • 50+ New titles a month
  • 1 Free eBook/Video to keep every month
Start Free Trial
 
Preview in Mapt

Book Details

ISBN 139781786466174
Paperback278 pages

Book Description

NGINX Cookbook covers the basics of configuring NGINX as a web server for use with common web frameworks such as WordPress and Ruby on Rails, through to utilization as a reverse proxy. Designed as a go-to reference guide, this book will give you practical answers based on real-world deployments to get you up and running quickly.

Recipes have also been provided for multiple SSL configurations, different logging scenarios, practical rewrites, and multiple load balancing scenarios. Advanced topics include covering bandwidth management, Docker container usage, performance tuning, OpenResty, and the NGINX Plus commercial features.

By the time you've read this book, you will be able to adapt and use a wide variety of NGINX implementations to solve any problems you have.

Table of Contents

Chapter 1: Let's Get Started
Introduction
A quick installation guide
Configuring NGINX
Enabling modules
Deploying a basic site
Basic monitoring
Real-time statistics
Chapter 2: Common PHP Scenarios
Introduction
Configuring NGINX for WordPress
WordPress multisite with NGINX
Running Drupal using NGINX
Using NGINX with MediaWiki
Using Magento with NGINX
Configuring NGINX for Joomla
Chapter 3: Common Frameworks
Introduction
Setting up Django with NGINX
Setting up NGINX with Express
Running Ruby on Rails with NGINX
Easy Flask with NGINX
Laravel via NGINX
Meteor applications with NGINX
High speed Beego with NGINX
Chapter 4: All About SSLs
Introduction
Basic SSL certificates
Enabling HTTP/2 on NGINX
Configuring HSTS in NGINX
Easy SSL certificates with Let's Encrypt
Making NGINX PCI DSS compliant
OCSP stapling with NGINX
Achieving full A+ Qualys rating
Chapter 5: Logging
Introduction
Logging to syslog
Customizing web access logs
Virtual host log format
Application focused logging
Logging TLS mode and cipher information
Logging POST data
Conditional logging
Using the Elastic Stack
Chapter 6: Rewrites
Introduction
Redirecting non-www to www-based sites
Redirecting to a new domain
Blocking malicious user agents
Redirecting all calls to HTTPS to secure your site
Redirecting pages and directories
Redirecting 404 errors through a search page
Chapter 7: Reverse Proxy
Introduction
Configuring NGINX as a simple reverse proxy
Content caching with NGINX
Monitoring cache status
Microcaching
Serving from cache when your backend is down
SSL termination proxy
Rate limiting
Chapter 8: Load Balancing
Introduction
Round robin load balancing
Least connected load balancing
Hash-based load balancing
Testing and debugging NGINX load balancing
TCP / application load balancing
NGINX as an SMTP load balancer
Chapter 9: Advanced Features
Introduction
Authentication with NGINX
WebDAV with NGINX
Bandwidth management with NGINX
Connection limiting with NGINX
Header modification with NGINX
Chapter 10: Docker Containers
Introduction
NGINX web server via Docker
NGINX reverse proxy via Docker
Docker Compose with NGINX
NGINX load balancing with Docker
Chapter 11: Performance Tuning
Introduction
Gzipping content in NGINX
Enhancing NGINX with keep alive
Tuning worker processes and connections
Fine tuning basic Linux system limits
Integrating ngx_pagespeed
Chapter 12: OpenResty
Introduction
Installing OpenResty
Getting started with OpenResty Lua
Lua microservices with OpenResty
Simple hit counter with a Redis backend
Powering API Gateways with OpenResty
Chapter 13: NGINX Plus – The Commercial Offering
Introduction
Installing NGINX Plus
Real-time server activity monitoring
Dynamic config reloading
Session persistence

What You Will Learn

  • Practical, real-world examples and recipes on how to use NGINX
  • Common CMS deployments such as WordPress, Joomla and more
  • NGINX configurations for frameworks such as Ruby on Rails, Django and more
  • Detailed SSL recipes, including HTTP/2
  • Real world rewrite examples
  • Basic web and TCP load balancing configuration
  • Bandwidth management and connection limiting
  • Detailed NGINX deployment scenarios with Docker
  • Performance tuning and monitoring of your NGINX deployments
  • OpenResty deployment guides
  • Advanced deployments with NGINX Plus features

Authors

Table of Contents

Chapter 1: Let's Get Started
Introduction
A quick installation guide
Configuring NGINX
Enabling modules
Deploying a basic site
Basic monitoring
Real-time statistics
Chapter 2: Common PHP Scenarios
Introduction
Configuring NGINX for WordPress
WordPress multisite with NGINX
Running Drupal using NGINX
Using NGINX with MediaWiki
Using Magento with NGINX
Configuring NGINX for Joomla
Chapter 3: Common Frameworks
Introduction
Setting up Django with NGINX
Setting up NGINX with Express
Running Ruby on Rails with NGINX
Easy Flask with NGINX
Laravel via NGINX
Meteor applications with NGINX
High speed Beego with NGINX
Chapter 4: All About SSLs
Introduction
Basic SSL certificates
Enabling HTTP/2 on NGINX
Configuring HSTS in NGINX
Easy SSL certificates with Let's Encrypt
Making NGINX PCI DSS compliant
OCSP stapling with NGINX
Achieving full A+ Qualys rating
Chapter 5: Logging
Introduction
Logging to syslog
Customizing web access logs
Virtual host log format
Application focused logging
Logging TLS mode and cipher information
Logging POST data
Conditional logging
Using the Elastic Stack
Chapter 6: Rewrites
Introduction
Redirecting non-www to www-based sites
Redirecting to a new domain
Blocking malicious user agents
Redirecting all calls to HTTPS to secure your site
Redirecting pages and directories
Redirecting 404 errors through a search page
Chapter 7: Reverse Proxy
Introduction
Configuring NGINX as a simple reverse proxy
Content caching with NGINX
Monitoring cache status
Microcaching
Serving from cache when your backend is down
SSL termination proxy
Rate limiting
Chapter 8: Load Balancing
Introduction
Round robin load balancing
Least connected load balancing
Hash-based load balancing
Testing and debugging NGINX load balancing
TCP / application load balancing
NGINX as an SMTP load balancer
Chapter 9: Advanced Features
Introduction
Authentication with NGINX
WebDAV with NGINX
Bandwidth management with NGINX
Connection limiting with NGINX
Header modification with NGINX
Chapter 10: Docker Containers
Introduction
NGINX web server via Docker
NGINX reverse proxy via Docker
Docker Compose with NGINX
NGINX load balancing with Docker
Chapter 11: Performance Tuning
Introduction
Gzipping content in NGINX
Enhancing NGINX with keep alive
Tuning worker processes and connections
Fine tuning basic Linux system limits
Integrating ngx_pagespeed
Chapter 12: OpenResty
Introduction
Installing OpenResty
Getting started with OpenResty Lua
Lua microservices with OpenResty
Simple hit counter with a Redis backend
Powering API Gateways with OpenResty
Chapter 13: NGINX Plus – The Commercial Offering
Introduction
Installing NGINX Plus
Real-time server activity monitoring
Dynamic config reloading
Session persistence

Book Details

ISBN 139781786466174
Paperback278 pages
Read More
From 1 reviews

Read More Reviews

Recommended for You

Learning Docker Book Cover
Learning Docker
$ 39.99
$ 8.00
Ubuntu Server Cookbook Book Cover
Ubuntu Server Cookbook
$ 39.99
$ 28.00
Object-Oriented JavaScript - Second Edition Book Cover
Object-Oriented JavaScript - Second Edition
$ 29.99
$ 21.00
Mastering Docker Book Cover
Mastering Docker
$ 39.99
$ 28.00
Mastering CentOS 7 Linux Server Book Cover
Mastering CentOS 7 Linux Server
$ 39.99
$ 28.00
Mastering KVM Virtualization Book Cover
Mastering KVM Virtualization
$ 39.99
$ 28.00