Skip to content

Commit aa43ca0

Browse files
alubbeagentzh
authored andcommitted
doc: stripped line trailing whitespaces.
Signed-off-by: Yichun Zhang (agentzh) <agentzh@gmail.com>
1 parent 793531d commit aa43ca0

File tree

2 files changed

+103
-103
lines changed

2 files changed

+103
-103
lines changed

README.markdown

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -623,9 +623,9 @@ Known Issues
623623

624624
TCP socket connect operation issues
625625
-----------------------------------
626-
The [tcpsock:connect](#tcpsockconnect) method may indicate `success` despite connection failures such as with `Connection Refused` errors.
626+
The [tcpsock:connect](#tcpsockconnect) method may indicate `success` despite connection failures such as with `Connection Refused` errors.
627627

628-
However, later attempts to manipulate the cosocket object will fail and return the actual error status message generated by the failed connect operation.
628+
However, later attempts to manipulate the cosocket object will fail and return the actual error status message generated by the failed connect operation.
629629

630630
This issue is due to limitations in the Nginx event model and only appears to affect Mac OS X.
631631

@@ -755,7 +755,7 @@ To avoid this, *double* escape the backslash:
755755

756756
Here, `\\\\d+` is stripped down to `\\d+` by the Nginx config file parser and this is further stripped down to `\d+` by the Lua language parser before running.
757757

758-
Alternatively, the regex pattern can be presented as a long-bracketed Lua string literal by encasing it in "long brackets", `[[...]]`, in which case backslashes have to only be escaped once for the Nginx config file parser.
758+
Alternatively, the regex pattern can be presented as a long-bracketed Lua string literal by encasing it in "long brackets", `[[...]]`, in which case backslashes have to only be escaped once for the Nginx config file parser.
759759

760760
```nginx
761761
@@ -772,7 +772,7 @@ Alternatively, the regex pattern can be presented as a long-bracketed Lua string
772772

773773
Here, `[[\\d+]]` is stripped down to `[[\d+]]` by the Nginx config file parser and this is processed correctly.
774774

775-
Note that a longer from of the long bracket, `[=[...]=]`, may be required if the regex pattern contains `[...]` sequences.
775+
Note that a longer from of the long bracket, `[=[...]=]`, may be required if the regex pattern contains `[...]` sequences.
776776
The `[=[...]=]` form may be used as the default form if desired.
777777

778778
```nginx
@@ -788,7 +788,7 @@ The `[=[...]=]` form may be used as the default form if desired.
788788
# evaluates to "1234"
789789
```
790790

791-
An alternative approach to escaping PCRE sequences is to ensure that Lua code is placed in external script files and executed using the various `*_by_lua_file` directives.
791+
An alternative approach to escaping PCRE sequences is to ensure that Lua code is placed in external script files and executed using the various `*_by_lua_file` directives.
792792
With this approach, the backslashes are only stripped by the Lua language parser and therefore only need to be escaped once each.
793793

794794
```lua
@@ -800,8 +800,8 @@ With this approach, the backslashes are only stripped by the Lua language parser
800800
-- evaluates to "1234"
801801
```
802802

803-
Within external script files, PCRE sequences presented as long-bracketed Lua string literals do not require modification.
804-
803+
Within external script files, PCRE sequences presented as long-bracketed Lua string literals do not require modification.
804+
805805
```lua
806806

807807
-- test.lua
@@ -1152,7 +1152,7 @@ The ngx_lua module does not support the `stat` mode available with the
11521152
Apache `mod_lua` module (yet).
11531153

11541154
Disabling the Lua code cache is strongly
1155-
discouraged for production use and should only be used during
1155+
discouraged for production use and should only be used during
11561156
development as it has a significant negative impact on overall performance. For example, the performance a "hello world" Lua example can drop by an order of magnitude after disabling the Lua code cache.
11571157

11581158
[Back to TOC](#directives)
@@ -1538,15 +1538,15 @@ set_by_lua_file
15381538

15391539
**phase:** *rewrite*
15401540

1541-
Equivalent to [set_by_lua](#set_by_lua), except that the file specified by `<path-to-lua-script-file>` contains the Lua code, or, as from the `v0.5.0rc32` release, the [Lua/LuaJIT bytecode](#lualuajit-bytecode-support) to be executed.
1541+
Equivalent to [set_by_lua](#set_by_lua), except that the file specified by `<path-to-lua-script-file>` contains the Lua code, or, as from the `v0.5.0rc32` release, the [Lua/LuaJIT bytecode](#lualuajit-bytecode-support) to be executed.
15421542

15431543
Nginx variable interpolation is supported in the `<path-to-lua-script-file>` argument string of this directive. But special care must be taken for injection attacks.
15441544

15451545
When a relative path like `foo/bar.lua` is given, they will be turned into the absolute path relative to the `server prefix` path determined by the `-p PATH` command-line option while starting the Nginx server.
15461546

1547-
When the Lua code cache is turned on (by default), the user code is loaded once at the first request and cached
1547+
When the Lua code cache is turned on (by default), the user code is loaded once at the first request and cached
15481548
and the Nginx config must be reloaded each time the Lua source file is modified.
1549-
The Lua code cache can be temporarily disabled during development by
1549+
The Lua code cache can be temporarily disabled during development by
15501550
switching [lua_code_cache](#lua_code_cache) `off` in `nginx.conf` to avoid reloading Nginx.
15511551

15521552
This directive requires the [ngx_devel_kit](https://github.com/simpl/ngx_devel_kit) module.
@@ -1565,7 +1565,7 @@ content_by_lua
15651565
**WARNING** Since the `v0.9.17` release, use of this directive is *discouraged*;
15661566
use the new [content_by_lua_block](#content_by_lua_block) directive instead.
15671567

1568-
Acts as a "content handler" and executes Lua code string specified in `<lua-script-str>` for every request.
1568+
Acts as a "content handler" and executes Lua code string specified in `<lua-script-str>` for every request.
15691569
The Lua code may make [API calls](#nginx-api-for-lua) and is executed as a new spawned coroutine in an independent global environment (i.e. a sandbox).
15701570

15711571
Do not use this directive and other content handler directives in the same location. For example, this directive and the [proxy_pass](http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_pass) directive should not be used in the same location.
@@ -1614,9 +1614,9 @@ Nginx variables can be used in the `<path-to-lua-script-file>` string to provide
16141614

16151615
When a relative path like `foo/bar.lua` is given, they will be turned into the absolute path relative to the `server prefix` path determined by the `-p PATH` command-line option while starting the Nginx server.
16161616

1617-
When the Lua code cache is turned on (by default), the user code is loaded once at the first request and cached
1617+
When the Lua code cache is turned on (by default), the user code is loaded once at the first request and cached
16181618
and the Nginx config must be reloaded each time the Lua source file is modified.
1619-
The Lua code cache can be temporarily disabled during development by
1619+
The Lua code cache can be temporarily disabled during development by
16201620
switching [lua_code_cache](#lua_code_cache) `off` in `nginx.conf` to avoid reloading Nginx.
16211621

16221622
Nginx variables are supported in the file path for dynamic dispatch, for example:
@@ -1934,7 +1934,7 @@ Nginx variables can be used in the `<path-to-lua-script-file>` string to provide
19341934

19351935
When a relative path like `foo/bar.lua` is given, they will be turned into the absolute path relative to the `server prefix` path determined by the `-p PATH` command-line option while starting the Nginx server.
19361936

1937-
When the Lua code cache is turned on (by default), the user code is loaded once at the first request and cached
1937+
When the Lua code cache is turned on (by default), the user code is loaded once at the first request and cached
19381938
and the Nginx config must be reloaded each time the Lua source file is modified.
19391939
The Lua code cache can be temporarily disabled during development by switching [lua_code_cache](#lua_code_cache) `off` in `nginx.conf` to avoid repeatedly reloading Nginx.
19401940

@@ -2175,7 +2175,7 @@ Runs the Lua source code inlined as the `<lua-script-str>` at the `log` request
21752175
Note that the following API functions are currently disabled within this context:
21762176

21772177
* Output API functions (e.g., [ngx.say](#ngxsay) and [ngx.send_headers](#ngxsend_headers))
2178-
* Control API functions (e.g., [ngx.exit](#ngxexit))
2178+
* Control API functions (e.g., [ngx.exit](#ngxexit))
21792179
* Subrequest API functions (e.g., [ngx.location.capture](#ngxlocationcapture) and [ngx.location.capture_multi](#ngxlocationcapture_multi))
21802180
* Cosocket API functions (e.g., [ngx.socket.tcp](#ngxsockettcp) and [ngx.req.socket](#ngxreqsocket)).
21812181

@@ -3439,7 +3439,7 @@ ngx.ctx
34393439
-------
34403440
**context:** *init_worker_by_lua&#42;, set_by_lua&#42;, rewrite_by_lua&#42;, access_by_lua&#42;, content_by_lua&#42;, header_filter_by_lua&#42;, body_filter_by_lua&#42;, log_by_lua&#42;, ngx.timer.&#42;, balancer_by_lua&#42;*
34413441

3442-
This table can be used to store per-request Lua context data and has a life time identical to the current request (as with the Nginx variables).
3442+
This table can be used to store per-request Lua context data and has a life time identical to the current request (as with the Nginx variables).
34433443

34443444
Consider the following example,
34453445

@@ -3702,7 +3702,7 @@ The `args` option can also take plain query strings:
37023702

37033703
This is functionally identical to the previous examples.
37043704

3705-
The `share_all_vars` option controls whether to share nginx variables among the current request and its subrequests.
3705+
The `share_all_vars` option controls whether to share nginx variables among the current request and its subrequests.
37063706
If this option is set to `true`, then the current request and associated subrequests will share the same Nginx variable scope. Hence, changes to Nginx variables made by a subrequest will affect the current request.
37073707

37083708
Care should be taken in using this option as variable scope sharing can have unexpected side effects. The `args`, `vars`, or `copy_all_vars` options are generally preferable instead.
@@ -3769,7 +3769,7 @@ In addition to the two settings above, it is possible to specify
37693769
values for variables in the subrequest using the `vars` option. These
37703770
variables are set after the sharing or copying of variables has been
37713771
evaluated, and provides a more efficient method of passing specific
3772-
values to a subrequest over encoding them as URL arguments and
3772+
values to a subrequest over encoding them as URL arguments and
37733773
unescaping them in the Nginx config file.
37743774

37753775
```nginx
@@ -3854,7 +3854,7 @@ Note that subrequests issued by [ngx.location.capture](#ngxlocationcapture) inhe
38543854
request headers of the current request by default and that this may have unexpected side effects on the
38553855
subrequest responses. For example, when using the standard `ngx_proxy` module to serve
38563856
subrequests, an "Accept-Encoding: gzip" header in the main request may result
3857-
in gzipped responses that cannot be handled properly in Lua code. Original request headers should be ignored by setting
3857+
in gzipped responses that cannot be handled properly in Lua code. Original request headers should be ignored by setting
38583858
[proxy_pass_request_headers](http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_pass_request_headers) to `off` in subrequest locations.
38593859

38603860
When the `body` option is not specified and the `always_forward_body` option is false (the default value), the `POST` and `PUT` subrequests will inherit the request bodies of the parent request (if any).
@@ -3994,7 +3994,7 @@ will yield
39943994
Set-Cookie: b=4; path=/
39953995
```
39963996

3997-
in the response headers.
3997+
in the response headers.
39983998

39993999
Only Lua tables are accepted (Only the last element in the table will take effect for standard headers such as `Content-Type` that only accept a single value).
40004000

@@ -4026,7 +4026,7 @@ The same applies to assigning an empty table:
40264026

40274027
Setting `ngx.header.HEADER` after sending out response headers (either explicitly with [ngx.send_headers](#ngxsend_headers) or implicitly with [ngx.print](#ngxprint) and similar) will throw out a Lua exception.
40284028

4029-
Reading `ngx.header.HEADER` will return the value of the response header named `HEADER`.
4029+
Reading `ngx.header.HEADER` will return the value of the response header named `HEADER`.
40304030

40314031
Underscores (`_`) in the header names will also be replaced by dashes (`-`) and the header names will be matched case-insensitively. If the response header is not present at all, `nil` will be returned.
40324032

@@ -4537,7 +4537,7 @@ That is, they will take Lua boolean values `true`. However, they are different f
45374537

45384538
Empty key arguments are discarded. `POST /test` with body `=hello&=world` will yield empty outputs for instance.
45394539

4540-
Note that a maximum of 100 request arguments are parsed by default (including those with the same name) and that additional request arguments are silently discarded to guard against potential denial of service attacks.
4540+
Note that a maximum of 100 request arguments are parsed by default (including those with the same name) and that additional request arguments are silently discarded to guard against potential denial of service attacks.
45414541

45424542
However, the optional `max_args` function argument can be used to override this limit:
45434543

@@ -4598,7 +4598,7 @@ the value of `ngx.req.get_headers()["Foo"]` will be a Lua (array) table such as:
45984598
{"foo", "bar", "baz"}
45994599
```
46004600

4601-
Note that a maximum of 100 request headers are parsed by default (including those with the same name) and that additional request headers are silently discarded to guard against potential denial of service attacks.
4601+
Note that a maximum of 100 request headers are parsed by default (including those with the same name) and that additional request headers are silently discarded to guard against potential denial of service attacks.
46024602

46034603
However, the optional `max_headers` function argument can be used to override this limit:
46044604

@@ -6007,7 +6007,7 @@ When the `replace` is a string, then it is treated as a special template for str
60076007

60086008
where `$0` referring to the whole substring matched by the pattern and `$1` referring to the first parenthesized capturing substring.
60096009

6010-
Curly braces can also be used to disambiguate variable names from the background string literals:
6010+
Curly braces can also be used to disambiguate variable names from the background string literals:
60116011

60126012
```lua
60136013

0 commit comments

Comments
 (0)