The ngx_http_stub_requests module provides provides access to basic requests information.
- Sources for nginx 1.x.x, and its dependencies.
Download nginx:
$ wget http://nginx.org/download/nginx-1.9.2.tar.gz
Unpack the nginx sources:
$ tar xzf nginx-1.9.2.tar.gz
Download the module:
$ wget https://github.com/atomx/nginx-http-stub-requests/archive/v1.0.1.tar.gz
Unpack the sources for the module:
$ tar xzf nginx-http-stub-requests-1.0.1.tar.gz
Change to the directory which contains the nginx sources, run the configuration script with the desired options and be sure to put an
--add-module
flag pointing to the directory which contains the source of the module:$ cd nginx-1.x.x $ ./configure --add-module=../nginx-http-stub-requests-1.0.1 [other configure options]
Build and install the software:
$ make && sudo make install
Configure nginx using the module's configuration directives.
You can enable stub_requests by adding the following lines into
a location
section in your nginx configuration file:
stub_requests;
You can find an example here: http://dubbelboer.com/requests
Syntax: | stub_requests |
---|---|
Default: | -- |
Context: | location |
Description: | The basic request information will be accessible from the surrounding location. |
Syntax: |
|
---|---|
Default: |
|
Context: | http |
Description: | The module keeps information about requests in shared memory so each worker can generate the requests page. The information includes the requested uri and the user agent. When the shared memory is full an error will be logged. This will not stop the request from continuing normally. |
Make sure to compile nginx with the ngx_echo module: http://wiki.nginx.org/HttpEchoModule:
$ ./configure --add-module=../nginx-http-stub-requests-1.0.1 --add-module=../echo-nginx-module [other configure options]
After that you can run the test against the nginx binary:
$ cd test $ NGINX=/home/erik/nginx-1.9.1/objs/nginx ./test.sh