Co m pl en ts of Derek DeJonghe im Complete NGINX Cookbook flawless application delivery Load Balancer Content Cache FREE TRIAL Web Server Security Controls Monitoring & Management LEARN MORE Complete NGINX Cookbook Advanced Recipes for Operations Derek DeJonghe Beijing Boston Farnham Sebastopol Tokyo NGINX Cookbook by Derek DeJonghe Copyright © 2017 O’Reilly Media Inc. All rights reserved. Printed in the United States of America. Published by O’Reilly Media, Inc., 1005 Gravenstein Highway North, Sebastopol, CA 95472. O’Reilly books may be purchased for educational, business, or sales promotional use. Online editions are also available for most titles (http://oreilly.com/safari). For more information, contact our corporate/institutional sales department: 800-998-9938 or corporate@oreilly.com. Editor: Virginia Wilson Acquisitions Editor: Brian Anderson Production Editor: Shiny Kalapurakkel Copyeditor: Amanda Kersey Proofreader: Sonia Saruba Interior Designer: David Futato Cover Designer: Karen Montgomery Illustrator: Rebecca Demarest First Edition March 2017: Revision History for the First Edition 2017-05-26: First Release The O’Reilly logo is a registered trademark of O’Reilly Media, Inc. NGINX Cook‐ book, the cover image, and related trade dress are trademarks of O’Reilly Media, Inc. While the publisher and the author have used good faith efforts to ensure that the information and instructions contained in this work are accurate, the publisher and the author disclaim all responsibility for errors or omissions, including without limi‐ tation responsibility for damages resulting from the use of or reliance on this work. Use of the information and instructions contained in this work is at your own risk. If any code samples or other technology this work contains or describes is subject to open source licenses or the intellectual property rights of others, it is your responsi‐ bility to ensure that your use thereof complies with such licenses and/or rights. 978-1-491-96895-6 [LSI] Table of Contents Part I. Part I: Load Balancing and HTTP Caching 1. High-Performance Load Balancing. . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 1.0 Introduction 1.1 HTTP Load Balancing 1.2 TCP Load Balancing 1.3 Load-Balancing Methods 1.4 Connection Limiting 1 2 3 4 6 2. Intelligent Session Persistence. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 2.0 Introduction 2.1 Sticky Cookie 2.2 Sticky Learn 2.3 Sticky Routing 2.4 Connection Draining 9 10 11 12 13 3. Application-Aware Health Checks. . . . . . . . . . . . . . . . . . . . . . . . . . . . 15 3.0 Introduction 3.1 What to Check 3.2 Slow Start 3.3 TCP Health Checks 3.4 HTTP Health Checks 15 15 16 17 18 4. High-Availability Deployment Modes. . . . . . . . . . . . . . . . . . . . . . . . 21 4.0 Introduction 4.1 NGINX HA Mode 21 21 v 4.2 Load-Balancing Load Balancers with DNS 4.3 Load Balancing on EC2 22 23 5. Massively Scalable Content Caching. . . . . . . . . . . . . . . . . . . . . . . . . . 25 5.0 Introduction 5.1 Caching Zones 5.2 Caching Hash Keys 5.3 Cache Bypass 5.4 Cache Performance 5.5 Purging 25 25 27 28 29 30 6. Sophisticated Media Streaming. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31 6.0 Introduction 6.1 Serving MP4 and FLV 6.2 Streaming with HLS 6.3 Streaming with HDS 6.4 Bandwidth Limits 31 31 32 34 34 7. Advanced Activity Monitoring. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37 7.0 Introduction 7.1 NGINX Traffic Monitoring 7.2 The JSON Feed 37 37 39 8. DevOps On-the-Fly Reconfiguration. . . . . . . . . . . . . . . . . . . . . . . . . . 41 8.0 Introduction 8.1 The NGINX API 8.2 Seamless Reload 8.3 SRV Records 41 41 43 44 9. UDP Load Balancing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 9.0 Introduction 9.1 Stream Context 9.2 Load-Balancing Algorithms 9.3 Health Checks 47 47 49 49 10. Cloud-Agnostic Architecture. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51 10.0 Introduction 10.1 The Anywhere Load Balancer 10.2 The Importance of Versatility vi | Table of Contents 51 51 52 Part II. Part II: Security and Access 11. Controlling Access. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 11.0 Introduction 11.1 Access Based on IP Address 11.2 Allowing Cross-Origin Resource Sharing 57 57 58 12. Limiting Use. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Complete_NGINX_Cookbook
温馨提示:如果当前文档出现乱码或未能正常浏览,请先下载原文档进行浏览。
本文档由 user 于 2020-12-27 08:53:10上传分享