Simple example on how to implement a nginx C module to obtain: Method, IP, User-Agent, Cookies, and Post/Get Variables
- Download nginx
wget https://nginx.org/download/nginx-1.18.1.tar.gz
tar -xzf nginx-1.18.1.tar.gz
export NGINX_PATH=$(pwd)/nginx-1.18.1/
- Compile the module
git clone https://github.com/bnchdan/ngx_http_hello_world
cd ngx_http_hello_world
./build.sh
- Compile the module
git clone https://github.com/bnchdan/ngx_http_hello_world
cd ngx_http_hello_world
./build.sh
load_module /my_path/ngx_http_hello_world_module.so;
...
http {
...
server{
...
location /hello_world {
hello_world;
}
...
}
...
}
...