- Add load_module ngx_http_stats_module.so; to /etc/nginx/nginx.conf
- Restart /etc/init.d/nginx restart
- In browser go to (ip/hostname)/ngx_stats
- Download nginx corresponding to your current version (Check with
nginx -v
)wget https://nginx.org/download/nginx-1.16.1.tar.gz tar -xzf nginx-1.16.1.tar.gz export NGINX_PATH=$(pwd)/nginx-1.16.1/
- Compile the module
git clone https://github.com/bnchdan/ngx_stats cd ngx_stats ./build.sh
- The dynamic module can be found at
${NGINX_PATH}/objs/ngx_http_stats_module.so
load_module {your_ngx_path}/objs/ngx_http_stats_module.so;
...
http {
...
server{
...
ngx_stats on;
ngx_stats_admin_ip "127.0.0.1";
...
}
...
}
...