Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including pm2-nginx with all npm packages installed. Try it out:

var pm2Nginx = require("pm2-nginx")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

pm2-nginx v1.0.1

PM2 Nginx Module

pm2-nginx

Nginx module for Keymetrics

pm2-nginx screenshot

Description

PM2 module to monitor key Nginx server metrics:

  • Accepted Connections / Handled Connections / Client Requests
  • Requests per Handled Connections Ratio
  • Currently Reading / Writing / Reading Connections

Requirements

This module requires an Nginx install (tested against v1.8.0). The ngx_http_stub_status_module needs to be enabled (please refer to this Tutorial)

Install

$ npm install pm2 -g

$ pm2 install pm2-nginx

Config

The default connection details are :
"protocol" : "http" "hostname" : "localhost"
"port" : 80
"statusPath" : "/nginx_stub_status"
"username" : "" // No Authentification by default
"password" : ""

To modify the config values you can use the commands:

$ pm2 set pm2-nginx:protocol https
$ pm2 set pm2-nginx:hostname localhost
$ pm2 set pm2-nginx:port 8080
$ pm2 set pm2-nginx:statusPath "/status"
$ pm2 set pm2-nginx:username "mike"
$ pm2 set pm2-nginx:password "123456"

Uninstall

$ pm2 uninstall pm2-nginx

License

MIT

Metadata

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free