nginx module for displaying uname as JSON
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
Dockerfile
LICENSE
Makefile
README.md
config
nginx.conf
nginx.dynamic.conf
ngx_http_uname_module.c
test.sh

README.md

ngx-uname

Nginx module for displaying uname as JSON (Linux only).

Installation

Firstly clone this repo somewhere.

Download Nginx source:

$ wget https://nginx.org/download/nginx-VERSION.tar.gz
$ tar -xzf nginx-VERSION.tar.gz
$ cd nginx-VERSION

Build as static module:

$ ./configure --add-module=/path/to/ngx-uname
$ make
$ sudo make install

Build as a dynamic module:

Usage

Specify a location in your Nginx configuration to display the data, which will be output as JSON (application/json):

location /uname {
  uname;
}

Example output:

{
  "sysname": "Linux",
  "nodename": "my-awesome-server",
  "release": "4.4.0-72-generic",
  "version": "#93-Ubuntu SMP Fri Mar 31 14:07:41 UTC 2017",
  "machine": "x86_64"
}

Testing

There's an included Dockerfile that will build this module against various versions of Nginx and do a simple curl test against an endpoint.

$ make test