You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.markdown
+21-21Lines changed: 21 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -204,7 +204,7 @@ Basically it provides various utilities that help testing and debugging of other
204
204
People will also find it useful in real-world applications that need to
205
205
206
206
1. serve static contents directly from memory (loading from the Nginx config file).
207
-
1. wrap the upstream response with custom header and footer (kinda like the `addition module` but with contents read directly from the config file and Nginx variables).
207
+
1. wrap the upstream response with custom header and footer (kinda like the [addition module](http://wiki.nginx.org/NginxHttpAdditionModule) but with contents read directly from the config file and Nginx variables).
208
208
1. merge contents of various "Nginx locations" (i.e., subrequests) together in a single main request (using `echo_location` and its friends).
209
209
210
210
This is a special dual-role module that can *lazily* serve as a content handler or register itself as an output filter only upon demand. By default, this module does not do anything at all.
@@ -226,13 +226,13 @@ Technially, this module has also demonstrated the following techniques that migh
226
226
Content Handler Directives
227
227
==========================
228
228
229
-
Use of the following directives register this module to the current Nginx location as a content handler. If you want to use another module, like the `standard proxy module`, as the content handler, use the `filter directives` provided by this module.
229
+
Use of the following directives register this module to the current Nginx location as a content handler. If you want to use another module, like the [standard proxy module](http://wiki.nginx.org/NginxHttpProxyModule), as the content handler, use the `filter directives` provided by this module.
230
230
231
231
All the content handler directives can be mixed together in a single Nginx location and they're supposed to run sequentially just as in the Bash scripting language.
232
232
233
233
Every content handler directive supports variable interpolation in its arguments (if any).
234
234
235
-
The MIME type set by the `standard default_type directive` is respected by this module, as in:
235
+
The MIME type set by the [standard default_type directive](http://wiki.nginx.org/NginxHttpCoreModule#default_type) is respected by this module, as in:
236
236
237
237
238
238
location /hello {
@@ -252,7 +252,7 @@ Then on the client side:
252
252
Connection: keep-alive
253
253
254
254
255
-
Since the `v0.22` release, all of the directives are allowed in the `rewrite module`'s `if` directive block, for instance:
255
+
Since the `v0.22` release, all of the directives are allowed in the [rewrite module](http://wiki.nginx.org/NginxHttpRewriteModule)'s [if](http://wiki.nginx.org/NginxHttpRewriteModule#if) directive block, for instance:
256
256
257
257
258
258
location ^~ /if {
@@ -290,7 +290,7 @@ Variables may appear in the arguments. An example is
290
290
echo The current request uri is $request_uri;
291
291
292
292
293
-
where `$request_uri` is a variable exposed by the `NginxHttpCoreModule`.
293
+
where [$request_uri](http://wiki.nginx.org/NginxHttpCoreModule#.24request_uri) is a variable exposed by the [NginxHttpCoreModule](http://wiki.nginx.org/NginxHttpCoreModule).
294
294
295
295
This command can be used multiple times in a single location configuration, as in
296
296
@@ -552,7 +552,7 @@ See also `echo_sleep` and `$echo_timer_elapsed`.
552
552
echo_read_request_body
553
553
----------------------
554
554
555
-
Explicitly reads request body so that the `$request_body` variable will always have non-empty values (unless the body is so big that it has been saved by Nginx to a local temporary file).
555
+
Explicitly reads request body so that the [$request_body](http://wiki.nginx.org/NginxHttpCoreModule#.24request_body) variable will always have non-empty values (unless the body is so big that it has been saved by Nginx to a local temporary file).
556
556
557
557
Note that this might not be the original client request body because the current request might be a subrequest with a "artificial" body specified by its parent.
558
558
@@ -585,9 +585,9 @@ The content of `/echoback` looks like this on my side (I was using Perl's LWP ut
585
585
world
586
586
587
587
588
-
Because `/echoback` is the main request, `$request_body` holds the original client request body.
588
+
Because `/echoback` is the main request, [$request_body](http://wiki.nginx.org/NginxHttpCoreModule#.24request_body) holds the original client request body.
589
589
590
-
Before Nginx 0.7.56, it makes no sense to use this directive because `$request_body` was first introduced in Nginx 0.7.58.
590
+
Before Nginx 0.7.56, it makes no sense to use this directive because [$request_body](http://wiki.nginx.org/NginxHttpCoreModule#.24request_body) was first introduced in Nginx 0.7.58.
591
591
592
592
This directive itself was first introduced in the echo module's `v0.14 release`.
593
593
@@ -678,7 +678,7 @@ Accessing `/main` yields
678
678
679
679
Querystrings is *not* allowed to be concatenated onto the `location` argument with "?" directly, for example, `/sub?foo=Foo&bar=Bar` is an invalid location, and shouldn't be fed as the first argument to this directive.
680
680
681
-
Due to an unknown bug in Nginx (it still exists in Nginx 0.8.20), the `standard SSI module` is required to ensure that the contents of the subrequests issued by this directive are correctly merged into the output chains of the main one. Fortunately, the SSI module is enabled by default during Nginx's `configure` process.
681
+
Due to an unknown bug in Nginx (it still exists in Nginx 0.8.20), the [standard SSI module](http://wiki.nginx.org/NginxHttpSsiModule) is required to ensure that the contents of the subrequests issued by this directive are correctly merged into the output chains of the main one. Fortunately, the SSI module is enabled by default during Nginx's `configure` process.
682
682
683
683
If calling this directive without SSI module enabled, you'll get truncated response without contents of any subrequests and get an alert message in your Nginx's `error.log`, like this:
684
684
@@ -978,7 +978,7 @@ It is a "no-op" if no request body has been read yet.
978
978
979
979
This directive was first introduced in the `release v0.18`.
980
980
981
-
See also `echo_read_request_body` and the `chunkin module`.
981
+
See also `echo_read_request_body` and the [chunkin module](http://wiki.nginx.org/NginxHttpChunkinModule).
982
982
983
983
echo_exec
984
984
---------
@@ -1069,7 +1069,7 @@ Accessing `/echo` from the client side yields
1069
1069
world
1070
1070
1071
1071
1072
-
In the previous sample, we borrow the `standard proxy module` to serve as the underlying content handler that generates the "main contents".
1072
+
In the previous sample, we borrow the [standard proxy module](http://wiki.nginx.org/NginxHttpProxyModule) to serve as the underlying content handler that generates the "main contents".
1073
1073
1074
1074
Multiple instances of this filter directive are also allowed, as in:
1075
1075
@@ -1182,7 +1182,7 @@ Behind the scene, it just takes the string data stored in `r->method_name`.
1182
1182
1183
1183
Compare it to the `$echo_client_request_method` variable.
1184
1184
1185
-
At least for Nginx 0.8.20 and older, the `$request_method` variable provided by the `http core module` is actually doing what our `$echo_client_request_method` is doing.
1185
+
At least for Nginx 0.8.20 and older, the [$request_method](http://wiki.nginx.org/NginxHttpCoreModule#.24request_method) variable provided by the [http core module](http://wiki.nginx.org/NginxHttpCoreModule) is actually doing what our `$echo_client_request_method` is doing.
1186
1186
1187
1187
This variable was first introduced in our `v0.15 release`.
1188
1188
@@ -1242,7 +1242,7 @@ $echo_request_uri
1242
1242
1243
1243
Evaluates to the parsed form of the URI (usually led by `/`) of the current (sub-)request. Unlike the `$echo_cacheable_request_uri` variable, it is *not* cacheable.
1244
1244
1245
-
This is quite different from the `$request_uri` variable exported by the `NginxHttpCoreModule`, because `$request_uri` is the *unparsed* form of the current request's URI.
1245
+
This is quite different from the [$request_uri](http://wiki.nginx.org/NginxHttpCoreModule#.24request_uri) variable exported by the [NginxHttpCoreModule](http://wiki.nginx.org/NginxHttpCoreModule), because `$request_uri` is the *unparsed* form of the current request's URI.
1246
1246
1247
1247
This variable was first introduced in `version 0.17`.
1248
1248
@@ -1329,9 +1329,9 @@ Modules that use this module for testing
1329
1329
1330
1330
The following modules take advantage of this `echo` module in their test suite:
1331
1331
1332
-
* The `memc` module that supports almost the whole memcached TCP protocol.
1333
-
* The `chunkin` module that adds HTTP 1.1 chunked input support to Nginx.
1334
-
* The `headers_more` module that allows you to add, set, and clear input and output headers under the conditions that you specify.
1332
+
* The [memc](http://wiki.nginx.org/NginxHttpMemcModule) module that supports almost the whole memcached TCP protocol.
1333
+
* The [chunkin](http://wiki.nginx.org/NginxHttpChunkinModule) module that adds HTTP 1.1 chunked input support to Nginx.
1334
+
* The [headers_more](http://wiki.nginx.org/NginxHttpHeadersMoreModule) module that allows you to add, set, and clear input and output headers under the conditions that you specify.
1335
1335
* The `echo` module itself.
1336
1336
1337
1337
Please mail me other modules that use `echo` in any form and I'll add them to the list above :)
@@ -1444,13 +1444,13 @@ v0.23
1444
1444
1445
1445
* now the subrequest can read the client request body directly (for the main request) because we made subrequests inherit its parent's `r->header_in` as well. This affects the `echo_read_request_body` directive.
1446
1446
* fixed `echo_after_body` in subrequests by using a hack (checking `cl->buf->sync` for the last buf) for nginx 0.8.7+ only.
1447
-
* added new varaible `$echo_response_status` to help testing the status code of a subrequest. (The `memc` module makes use of it.)
1447
+
* added new varaible `$echo_response_status` to help testing the status code of a subrequest. (The [memc](http://wiki.nginx.org/NginxHttpMemcModule) module makes use of it.)
1448
1448
* use the `ngx_calloc_buf` macro to allocate new bufs in the code rather than explicit `ngx_pcalloc` calls for safety.
1449
1449
1450
1450
v0.22
1451
1451
-----
1452
1452
1453
-
* Now we allowed all the directives appear in the `rewrite module`'s `if` block. But so far I've only tested the `echo` directive.
1453
+
* Now we allowed all the directives appear in the [rewrite module](http://wiki.nginx.org/NginxHttpRewriteModule)'s [if](http://wiki.nginx.org/NginxHttpRewriteModule#if) block. But so far I've only tested the `echo` directive.
1454
1454
1455
1455
v0.21
1456
1456
-----
@@ -1555,7 +1555,7 @@ At the moment, [LWP::UserAgent](http://search.cpan.org/perldoc?LWP::UserAgent) i
1555
1555
1556
1556
Because a single nginx server (by default, `localhost:1984`) is used across all the test scripts (`.t` files), it's meaningless to run the test suite in parallel by specifying `-jN` when invoking the `prove` utility.
1557
1557
1558
-
Some parts of the test suite requires standard modules `proxy`, `rewrite` and `SSI` to be enabled as well when building Nginx.
1558
+
Some parts of the test suite requires standard modules [proxy](http://wiki.nginx.org/NginxHttpProxyModule), [rewrite](http://wiki.nginx.org/NginxHttpRewriteModule) and [SSI](http://wiki.nginx.org/NginxHttpSsiModule) to be enabled as well when building Nginx.
1559
1559
1560
1560
TODO
1561
1561
====
@@ -1670,6 +1670,6 @@ See Also
1670
1670
========
1671
1671
1672
1672
* The original [blog post](http://agentzh.blogspot.com/2009/10/hacking-on-nginx-echo-module.html) about this module's initial development.
1673
-
* The standard `addition filter module`.
1674
-
* The standard `proxy module`.
1673
+
* The standard [addition filter module](http://wiki.nginx.org/NginxHttpAdditionModule).
1674
+
* The standard [proxy module](http://wiki.nginx.org/NginxHttpProxyModule).
0 commit comments