This book is for advanced users such as system administrators and developers who want to extend Nginx's functionality using its highly flexible add-on system. We look at the existing modules available and how to compile and install them, along with practical examples of how to configure them with focus on optimizing the configuration. It also goes beyond what is available off the shelf and teaches you how to write your own module, in case something is not available from the big Nginx open source community.
Chapter 1, Installing Nginx Core and Modules from Source, serves as a quick reference for downloading and installing Nginx and compilation options related to different modules and add-ons.
Chapter 2, Configuring Core Modules, is a reference to the core modules in Nginx, which cannot be disabled, and explores different configuration options for them.
Chapter 3, Installing and Configuring HTTP Modules, is a reference to the standard and optional HTTP modules, their synopsis, directives as well as practical configuration examples.
Chapter 4, Installing Third-party Modules, introduces third-party modules, mostly available on GitHub. It talks about some well-known third-party modules, their installation and configuration, and also some guidelines on how to find different third-party modules out there.
Chapter 5, Creating Your Own Module, gives a brief introduction to creating your own modules. This chapter is a quick reference to the module system in Nginx. It also has a quick reference to the internal architecture of Nginx, which makes extension possible.
This book will help you understand the module-based architecture of Nginx. You will learn to install Nginx as well as extend it with several available modules. This book specially touches on the topic of creating your own Nginx modules. Most people have to read heaps of code to get this done. This book will make it easier for advanced users who are looking to extend Nginx by not only using existing modules, but also writing something of their own.
This book is intended for advanced users, system administrators, and developers of Nginx modules.
In this book, you will find a number of styles of text that distinguish between different kinds of information. Here are some examples of these styles, and an explanation of their meaning.
Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "You can reload the Nginx configuration once you edit the nginx.conf
file."
A block of code is set as follows:
[nginx] name=nginx repo baseurl=http://nginx.org/packages/centos/$releasever/$basearch/ gpgcheck=0 enabled=1
When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:
ngx_uint_t spare0; ngx_uint_t spare1; ngx_uint_t spare2; ngx_uint_t spare3; ngx_uint_t version; void *ctx;
Any command-line input or output is written as follows:
# cd /usr/ports/www/nginx # make install clean
New terms and important words are shown in bold. Words that you see on the screen, in menus or dialog boxes, for example, appear in the text like this: "For example, according to the following configuration, this module will make sure that it prints Hello World."
Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or may have disliked. Reader feedback is important for us to develop titles that you really get the most out of.
To send us general feedback, simply send an e-mail to <[email protected]>
, and mention the book title via the subject of your message.
If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide on www.packtpub.com/authors.
Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.
Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you would report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting your book, clicking on the errata submission form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded on our website, or added to any list of existing errata, under the Errata section of that title. Any existing errata can be viewed by selecting your title from http://www.packtpub.com/support.
Piracy of copyright material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works, in any form, on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.
Please contact us at <[email protected]>
with a link to the suspected pirated material.
We appreciate your help in protecting our authors, and our ability to bring you valuable content.
You can contact us at <[email protected]>
if you are having a problem with any aspect of the book, and we will do our best to address it.