Search

Introduction

단원
ģž‘ģ„±ģž
ģµœģ¢…ķŽøģ§‘ģ¼ģ‹œ
2021/05/14 08:30
ģƒģ„±ģ¼
2021/05/14 07:37

NGINX Cookbook

NGINX is one of the most widely used web servers available today, in part because of its capabilities as a load balancer and reverse proxy server for HTTP and other network protocols. This cookbook provides easy-to-follow examples to real-world problems in application delivery. The practical recipes will help you set up and use either the open source or commercial offering to solve problems in various use cases.
For professionals who understand modern web architectures, such as n-tier or microservice designs, and common web protocols including TCP and HTTP, these recipes provide proven solutions for security, software load balancing, and monitoring and maintaining NGINX's application delivery platform. You'll also explore advanced features of both NGINX and NGINX Plus, the free and licensed versions of this server.
You'll find recipes for:
•
High-performance load balancing with HTTP, TCP, and UDP
•
Securing access through encrypted traffic, secure links, HTTP authentication subrequests, and more
•
Deploying NGINX to Google Cloud, AWS, and Azure cloud computing service
•
Setting up and configuring NGINX Controller
•
Installing and configuring the NGINX Plus App Protect module
•
Enabling WAF through Controller ADC

Foreword

Welcome to the 2020 edition of the NGINX Cookbook. O’Reilly has been publishing the NGINX Cookbook for almost five years, and a lot has changed. However, one thing hasn’t: every day, more and more of the world’s websites choose to run on NGINX. Today there are over 445 million, nearly double the number when the cookbook was first released—and millions more than when NGINX was first released.
Since I wrote the first version of NGINX in 2002, it’s grown to become the load balancer, web server, reverse proxy, and API gateway of choice for many websites and organizations—and it’s still growing. NGINX is a Swiss Army Knife: it can be used in almost any dataplane scenario, including as a content cache, web application firewall (WAF), and content delivery network (CDN). Not to mention the fact that it’s fast and reliable.
TheĀ NGINX CookbookĀ shows you how to get the most out of NGINX—whether NGINX Open Source or NGINX Plus. You’ll find over 170 pages of easy-to-follow recipes covering how to install NGINX, how to configure it for almost any use case, along with debugging and troubleshooting.
This version includes updates to many sections to cover new functionality in NGINX, as well as entirely new sections and chapters. With the introduction of NGINX App Protect, we’ve expanded on security in NGINX, along with the expanded NGINX Controller coverage in parallel to the stunning new features introduced to NGINX Controller in 2020 (with more to come).
I hope you enjoy theĀ NGINX Cookbook, and that it contributes to your success creating and deploying applications with NGINX—fulfilling the vision I had all those years ago.
—Igor Sysoev, NGINX Author and Founder

Preface

TheĀ NGINX CookbookĀ aims to provide easy-to-follow examples to real-world problems in application delivery. Throughout this book, you will explore the many features of NGINX and how to use them. This guide is fairly comprehensive, and touches on most of the main capabilities of NGINX.
Throughout this book, there will be references to both the free and open source NGINX software, as well as the commercial products from NGINX, Inc., NGINX Plus and NGINX Controller. Features and directives that are only available as part of the paid subscription to NGINX Plus will be denoted as such. Because NGINX Plus is anĀ application delivery controllerĀ (ADC), and provides many advanced features, it’s important to highlight these features to gain a full view of the possibilities of the platform.
The book will begin by explaining the installation process of NGINX and NGINX Plus, as well as some basic getting started steps for readers new to NGINX. From there, the sections will progress to load balancing in all forms, accompanied by chapters about traffic management, caching, and automation. The security chapter covers a lot of ground but is important, because NGINX is often the first point of entry for web traffic to your application, and the first line of application-layer defense. There are a number of chapters that cover cutting-edge topics such as HTTP/2, websockets, media streaming, cloud and container environments—wrapping up with more traditional operational topics such as monitoring, debugging, performance, and operational tips. The book will end with an introduction to NGINX Controller, an application-centric management platform.
I personally use NGINX as a multitool, and believe this book will enable you to do the same. It’s software that I believe in and enjoy working with. I’m happy to share this knowledge with you, and hope that as you read through this book you relate the recipes to your real-world scenarios and will employ these solutions.

Conventions Used in This Book

Using Code Examples

If you have a technical question or a problem using the code examples, please send an email toĀ bookquestions@oreilly.com.
This book is here to help you get your job done. In general, if example code is offered with this book, you may use it in your programs and documentation. You do not need to contact us for permission unless you’re reproducing a significant portion of the code. For example, writing a program that uses several chunks of code from this book does not require permission. Selling or distributing examples from O’Reilly books does require permission. Answering a question by citing this book and quoting example code does not require permission. Incorporating a significant amount of example code from this book into your product’s documentation does require permission.
We appreciate, but generally do not require, attribution. An attribution usually includes the title, author, publisher, and ISBN. For example: ā€œNGINX CookbookĀ by Derek DeJonghe (O’Reilly). Copyright 2021 O’Reilly Media, Inc., 978-1-492-07848-7.ā€
If you feel your use of code examples falls outside fair use or the permission given above, feel free to contact us atĀ permissions@oreilly.com.