Mastering NGINX - Second Edition

An in-depth guide to confi guring NGINX for your everyday server needs

Mastering NGINX - Second Edition

This ebook is included in a Mapt subscription
Dimitri Aivaliotis

1 customer reviews
An in-depth guide to confi guring NGINX for your everyday server needs
$0.00
$34.00
$49.99
$29.99p/m after trial
RRP $39.99
RRP $49.99
Subscription
eBook
Print + eBook
Start 30 Day Trial
Subscribe and access every Packt eBook & Video.
 
  • 4,000+ eBooks & Videos
  • 40+ New titles a month
  • 1 Free eBook/Video to keep every month
Start Free Trial
 
Code Files
Preview in Mapt

Book Details

ISBN 139781782173311
Paperback320 pages

Book Description

NGINX is a high-performance HTTP server and mail proxy designed to use very few system resources. But despite its power it is often a challenge to properly configure NGINX to meet your expectations. Mastering Nginx is the solution – an insider’s guide that will clarify the murky waters of NGINX’s configuration. Tune NGINX for various situations, improve your NGINX experience with some of the more obscure configuration directives, and discover how to design and personalize a configuration to match your needs.

To begin with, quickly brush up on installing and setting up the NGINX server on the OS and its integration with third-party modules. From here, move on to explain NGINX's mail proxy module and its authentication, and reverse proxy to solve scaling issues. Then see how to integrate NGINX with your applications to perform tasks.

The latter part of the book focuses on working through techniques to solve common web issues and the know-hows using NGINX modules. Finally, we will also explore different configurations that will help you troubleshoot NGINX server and assist with performance tuning.

Table of Contents

Chapter 1: Installing NGINX and Third-Party Modules
Installing NGINX using a package manager
Installing NGINX from source
Configuring SSL support
Enabling various modules
Finding and installing third-party modules
Adding support for Lua
Putting it all together
Summary
Chapter 2: A Configuration Guide
The basic configuration format
NGINX global configuration parameters
Using the include files
The HTTP server section
The virtual server section
Locations – where, when, and how
Full sample configuration
Summary
Chapter 3: Using the mail Module
Basic proxy service
Authentication service
Combining with memcached
Interpreting log files
Operating system limits
Summary
Chapter 4: NGINX as a Reverse Proxy
Introducing reverse proxying
The proxy module
Legacy servers with cookies
The upstream module
Keepalive connections
Types of upstream servers
Single upstream server
Multiple upstream servers
Non-HTTP upstream servers
Load-balancing
Converting an if-fy configuration to a more modern interpretation
Using error documents to handle upstream problems
Determining the client's real IP address
Summary
Chapter 5: Reverse Proxy Advanced Topics
Security through separation
Isolating application components for scalability
Reverse proxy performance tuning
Summary
Chapter 6: The NGINX HTTP Server
NGINX's architecture
The HTTP core module
Using limits to prevent abuse
Restricting access
Streaming media files
Predefined variables
SPDY and HTTP/2
Using NGINX with PHP-FPM
Wiring NGINX and uWSGI together
Summary
Chapter 7: NGINX for the Application Developer
Caching integration
Changing content on-the-fly
Using Server Side Includes
Decision-making in NGINX
Creating a secure link
Generating images
Tracking website visitors
Preventing inadvertent code execution
Summary
Chapter 8: Integrating Lua with NGINX
The ngx_lua module
Integrating with Lua
Logging with Lua
Summary
Chapter 9: Troubleshooting Techniques
Analyzing log files
Configuring advanced logging
Common configuration errors
Operating system limits
Performance problems
Using the Stub Status module
Summary

What You Will Learn

  • Compile the right third-party module to meet your needs
  • Write an authentication server to use with the mail proxy module
  • Create your own SSL certificates to encrypt connections
  • Use try_files to solve your file-existence check problems
  • Cache and compress responses to get speedier user interaction
  • Integrate popular PHP frameworks with the FastCGI module
  • Construct useful logging configurations

Authors

Table of Contents

Chapter 1: Installing NGINX and Third-Party Modules
Installing NGINX using a package manager
Installing NGINX from source
Configuring SSL support
Enabling various modules
Finding and installing third-party modules
Adding support for Lua
Putting it all together
Summary
Chapter 2: A Configuration Guide
The basic configuration format
NGINX global configuration parameters
Using the include files
The HTTP server section
The virtual server section
Locations – where, when, and how
Full sample configuration
Summary
Chapter 3: Using the mail Module
Basic proxy service
Authentication service
Combining with memcached
Interpreting log files
Operating system limits
Summary
Chapter 4: NGINX as a Reverse Proxy
Introducing reverse proxying
The proxy module
Legacy servers with cookies
The upstream module
Keepalive connections
Types of upstream servers
Single upstream server
Multiple upstream servers
Non-HTTP upstream servers
Load-balancing
Converting an if-fy configuration to a more modern interpretation
Using error documents to handle upstream problems
Determining the client's real IP address
Summary
Chapter 5: Reverse Proxy Advanced Topics
Security through separation
Isolating application components for scalability
Reverse proxy performance tuning
Summary
Chapter 6: The NGINX HTTP Server
NGINX's architecture
The HTTP core module
Using limits to prevent abuse
Restricting access
Streaming media files
Predefined variables
SPDY and HTTP/2
Using NGINX with PHP-FPM
Wiring NGINX and uWSGI together
Summary
Chapter 7: NGINX for the Application Developer
Caching integration
Changing content on-the-fly
Using Server Side Includes
Decision-making in NGINX
Creating a secure link
Generating images
Tracking website visitors
Preventing inadvertent code execution
Summary
Chapter 8: Integrating Lua with NGINX
The ngx_lua module
Integrating with Lua
Logging with Lua
Summary
Chapter 9: Troubleshooting Techniques
Analyzing log files
Configuring advanced logging
Common configuration errors
Operating system limits
Performance problems
Using the Stub Status module
Summary

Book Details

ISBN 139781782173311
Paperback320 pages
Read More
From 1 reviews

Read More Reviews