Book Image

Nginx Module Extension

By : Usama Dar
Book Image

Nginx Module Extension

By: Usama Dar

Overview of this book

<p>Companies can solve significant scaling issues thanks to switching their web platforms to Nginx. A popular web server for building web infrastructure, Nginx transparently and effectively enables the growth of the largest sites on the Internet today, on top of being free and open source.</p> <p>This book is a practical reference providing you with everything you need to know about Nginx module extensions. You will learn how to write powerful and flexible configuration files and your own modules, as well as gaining knowledge about Nginx’s modular architecture, available modules, and their intricate details.</p> <p>Nginx Module Extension starts by teaching you to compile the Nginx source on multiple platforms. Then you will learn the synopsis, directives, and practical examples of the core, optional, and third party Nginx modules before familiarizing yourself with Nginx internals, enabling you to write custom modules.</p> <p>You will learn about the flexibility of the Nginx configuration and how to enable and disable various options while building from the source. You will learn to customize the Main and Events module to fine-tune the web server performance, and you will also learn about standard and optional HTTP modules like GeoIP, Gzip, Access Control, and using SSL, along with an exploration of PostgreSQL, MySQL, and Memcached modules. Finally you will learn internals like module chaining and will see sample code and a line-by-line walkthrough demonstrating how to write your own module.</p>
Table of Contents (12 chapters)

Nginx Development Toolkit (NDK)


NDK is an Nginx module that makes it easier for the module developers to develop Nginx modules. As you have seen in this chapter so far, there are certain generic tasks that are repetitive as you are developing modules. NDK provides you with some built-in macros and functions that will reduce the amount of code you will have to write to develop a module.

In order to use NDK, you will have to add it as a module just like any other module. If you wish to use the macros and functions provided by this module, you will have to include the ndk.h file in your module source as well.

NDK provides useful utilities such as conf set functions for complex types such as paths and regular expressions, utility methods for NULL checking, returning values, and setting data to zero.

NDK also includes an Auto Lib Core that allows the developers and users to include external libraries in Nginx in a consistent, cross-platform manner.

You can see more details and documentation at https...