Now we will proceed towards creating a simple Nginx module. This module will print a configurable text in your browser whenever you enter a specific location. This is a very simple module and the idea is to just introduce the core concepts of how to create an Nginx module. This is based on and is an enhanced version of the simple Hello world module found at http://blog.zhuzhaoyuan.com/2009/08/creating-a-hello-world-nginx-module/. This module is an example of a handler module.
The first thing you have to do is to obviously create a folder for your new module. Create it anywhere other than the Nginx source tree. You should create the following two files to start with:
config
ngx_http_hello_module.c
The contents of the config
file will depend on what kind of module you are writing.
For this simple module, it will look like the following code:
ngx_addon_name=ngx_http_hello_module HTTP_MODULES="$HTTP_MODULES ngx_http_hello_module"...