Год: 2013 Автор: Dimitri Aivaliotis Издательство: Packt Publishing ISBN: 978-1-84951-744-7 Язык: Английский Формат: PDF+EPUB Качество: Изначально компьютерное (eBook) Интерактивное оглавление: Да Количество страниц: 322 Описание:
An in-depth guide to configuring NGINX for any situation, including numerous examples and reference tables describing each directive.
NGINX is a high-performance web server designed to use very few system resources. There are many how-to''s and example configurations floating around on the Web. This guide will serve to clarify the murky waters of NGINX configuration. In doing so you will learn how to tune NGINX for various situations, what some of the more obscure configuration options do, and how to design a decent configuration to match your needs.
You will no longer feel the need to copy-paste a configuration snippet because you will understand how to construct a configuration file to do exactly what you want it to do. This is a process, and there will be bumps along the way, but with the tips explained in this book you will feel comfortable writing an NGINX configuration file by hand. In case something doesn''t work as expected, you will be able to debug the problem yourself or at least be capable of asking for help without feeling like you haven''t given it a try yourself.
This book is written in a modular fashion. It is laid out to help you get to the information you need as quickly as possible. Each chapter is pretty much a standalone piece. Feel free to jump in anywhere you feel you need to get more in-depth about a particular topic. If you feel you have missed something major, go back and read the earlier chapters. They are constructed in a way to help you grow your configuration piece-by-piece.
Author: Dimitri Aivaliotis
Dimitri Aivaliotis works as a Systems Architect at a hosting provider in Zurich, Switzerland. His career has taken him from building a Linux-based computer network for a school up through dual-datacenter high-availability infrastructures for banks and online portals. He has spent over a decade solving his customers’ problems and discovered NGINX along the way. He uses the software daily to provide web serving, proxying, and media-streaming services to his customers.
Dimitri graduated summa cum laude with a BS in Physics from Rensselaer Polytechnic Institute and received an MS in Management Information Systems at Florida State University.
This is his first book.
Preface
Chapter 1: Installing NGINX and Third-Party Modules
Installing NGINX using a package manager CentOS Debian Installing NGINX from source Preparing a build environment Compiling from source Table: Common configure options Table: Configure options for optimization Configuring for web or mail service Configure options for a mail proxy Table: Mail configure options Configure the options to specify paths Table: HTTP configure options Enabling various modules Table: HTTP module configure options Disabling unused modules Table: Disable configure options Finding and installing third-party modules Putting it all together Summary
Chapter 2: A Configuration Guide
The basic configuration format NGINX global configuration parameters Table: Global configuration directives Using include files The HTTP server section Client directives Table: HTTP client directives File I/O directives Table: HTTP file I/O directives Hash directives Table: HTTP hash directives Socket directives Table: HTTP socket directives Sample configuration The virtual server section Table: listen parameters Locations – where, when, and how Table: Location modifiers Table: Location-only directives The mail server section Table: Mail module directives Table: Mail SSL directives Full sample configuration Summary
Chapter 3: Using the Mail Module
Basic proxy service POP3 service IMAP service SMTP service Using SSL/TLS Complete mail example Authentication service Combining with memcached Interpreting log files Operating system limits Summary
Chapter 4: NGINX as a Reverse Proxy
Introduction to reverse proxying The proxy module Table: Proxy module directives Legacy servers with cookies The upstream module Table: Upstream module directives Keepalive connections Load-balancing algorithms Types of upstream servers Single upstream server Multiple upstream servers Non-HTTP upstream servers Memcached upstream servers FastCGI upstream servers SCGI upstream servers uWSGI upstream servers 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 Encrypting traffic with SSL Authenticating clients using SSL Blocking traffic based on originating IP address Isolating application components for scalability Reverse proxy performance tuning Buffering Table: Proxy module buffering directives Caching Table: Proxy module caching directives Storing Compressing Table: Gzip module directives Summary
Chapter 6: The NGINX HTTP Server
NGINX''s architecture The HTTP core module The server Table: HTTP server directives Logging Table: HTTP logging directives Table: Log format variables Finding files Table: HTTP file-path directives Name resolution Table: Name resolution directives Client interaction Table: HTTP client interaction directives Using limits to prevent abuse Table: HTTP limits directives Restricting access Table: HTTP access module directives Streaming media files Table: HTTP streaming directives Predefined variables Table: HTTP variables Using NGINX with PHP-FPM Table: FastCGI directives An example Drupal configuration Wiring NGINX and uWSGI together An example Django configuration Summary
Chapter 7: NGINX for the Developer
Caching integration No application caching Caching in the database Table: Memcached module directives Caching in the filesystem Table: Header modifying directives Changing content on-the-fly The addition module Table: HTTP addition module directives The sub module Table: HTTP sub module directives The xslt module Table: HTTP XSLT module directives Using Server Side Includes Table: Server Side Includes directives Table: Server Side Includes commands Decision-making in NGINX Table: Perl module directives Creating a secure link Generating images Table: Image filter directives Tracking website visitors Table: UserID module directives Preventing inadvertent code execution Summary
Chapter 8: Troubleshooting Techniques
Analyzing log files Error log file formats Error log file entry examples Configuring advanced logging Debug logging Switching binaries at runtime Using access logs for debugging Common configuration errors Using if instead of try_files Using if as a hostname switch Not using the server context to best effect Operating system limits File descriptor limits Network limits Performance problems Using the Stub Status module Summary
Appendix A: Directive Reference
Table: Directive reference
Appendix B: Rewrite Rule Guide
Introducing the rewrite module Table: Rewrite module directives Creating new rewrite rules Translating from Apache Rule #1: Replace directory and file existence checks with try_files Rule #2: Replace matches against REQUEST_URI with a location Rule #3: Replace matches against HTTP_HOST with a server Rule #4: Replace RewriteCond with if for variable checks Summary
Appendix C: The NGINX Community
Mailing list IRC channel Web resources Writing a good bug report Summary
Appendix D: Persisting Solaris Network Tunings
Index
Внимание! AdBlock блокирует показ скриншотов, все вопросы к разработчикам )))