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
+25-25Lines changed: 25 additions & 25 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -623,9 +623,9 @@ Known Issues
623
623
624
624
TCP socket connect operation issues
625
625
-----------------------------------
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.
627
627
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.
629
629
630
630
This issue is due to limitations in the Nginx event model and only appears to affect Mac OS X.
631
631
@@ -755,7 +755,7 @@ To avoid this, *double* escape the backslash:
755
755
756
756
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.
757
757
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.
759
759
760
760
```nginx
761
761
@@ -772,7 +772,7 @@ Alternatively, the regex pattern can be presented as a long-bracketed Lua string
772
772
773
773
Here, `[[\\d+]]` is stripped down to `[[\d+]]` by the Nginx config file parser and this is processed correctly.
774
774
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.
776
776
The `[=[...]=]` form may be used as the default form if desired.
777
777
778
778
```nginx
@@ -788,7 +788,7 @@ The `[=[...]=]` form may be used as the default form if desired.
788
788
# evaluates to "1234"
789
789
```
790
790
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.
792
792
With this approach, the backslashes are only stripped by the Lua language parser and therefore only need to be escaped once each.
793
793
794
794
```lua
@@ -800,8 +800,8 @@ With this approach, the backslashes are only stripped by the Lua language parser
800
800
-- evaluates to "1234"
801
801
```
802
802
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
+
805
805
```lua
806
806
807
807
-- test.lua
@@ -1152,7 +1152,7 @@ The ngx_lua module does not support the `stat` mode available with the
1152
1152
Apache `mod_lua` module (yet).
1153
1153
1154
1154
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
1156
1156
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.
1157
1157
1158
1158
[Back to TOC](#directives)
@@ -1538,15 +1538,15 @@ set_by_lua_file
1538
1538
1539
1539
**phase:***rewrite*
1540
1540
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.
1542
1542
1543
1543
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.
1544
1544
1545
1545
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.
1546
1546
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
1548
1548
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
1550
1550
switching [lua_code_cache](#lua_code_cache)`off` in `nginx.conf` to avoid reloading Nginx.
1551
1551
1552
1552
This directive requires the [ngx_devel_kit](https://github.com/simpl/ngx_devel_kit) module.
@@ -1565,7 +1565,7 @@ content_by_lua
1565
1565
**WARNING** Since the `v0.9.17` release, use of this directive is *discouraged*;
1566
1566
use the new [content_by_lua_block](#content_by_lua_block) directive instead.
1567
1567
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.
1569
1569
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).
1570
1570
1571
1571
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
1614
1614
1615
1615
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.
1616
1616
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
1618
1618
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
1620
1620
switching [lua_code_cache](#lua_code_cache)`off` in `nginx.conf` to avoid reloading Nginx.
1621
1621
1622
1622
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
1934
1934
1935
1935
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.
1936
1936
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
1938
1938
and the Nginx config must be reloaded each time the Lua source file is modified.
1939
1939
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.
1940
1940
@@ -2175,7 +2175,7 @@ Runs the Lua source code inlined as the `<lua-script-str>` at the `log` request
2175
2175
Note that the following API functions are currently disabled within this context:
2176
2176
2177
2177
* 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))
2179
2179
* Subrequest API functions (e.g., [ngx.location.capture](#ngxlocationcapture) and [ngx.location.capture_multi](#ngxlocationcapture_multi))
2180
2180
* Cosocket API functions (e.g., [ngx.socket.tcp](#ngxsockettcp) and [ngx.req.socket](#ngxreqsocket)).
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).
3443
3443
3444
3444
Consider the following example,
3445
3445
@@ -3702,7 +3702,7 @@ The `args` option can also take plain query strings:
3702
3702
3703
3703
This is functionally identical to the previous examples.
3704
3704
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.
3706
3706
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.
3707
3707
3708
3708
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
3769
3769
values for variables in the subrequest using the `vars` option. These
3770
3770
variables are set after the sharing or copying of variables has been
3771
3771
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
3773
3773
unescaping them in the Nginx config file.
3774
3774
3775
3775
```nginx
@@ -3854,7 +3854,7 @@ Note that subrequests issued by [ngx.location.capture](#ngxlocationcapture) inhe
3854
3854
request headers of the current request by default and that this may have unexpected side effects on the
3855
3855
subrequest responses. For example, when using the standard `ngx_proxy` module to serve
3856
3856
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
3858
3858
[proxy_pass_request_headers](http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_pass_request_headers) to `off` in subrequest locations.
3859
3859
3860
3860
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
3994
3994
Set-Cookie: b=4; path=/
3995
3995
```
3996
3996
3997
-
in the response headers.
3997
+
in the response headers.
3998
3998
3999
3999
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).
4000
4000
@@ -4026,7 +4026,7 @@ The same applies to assigning an empty table:
4026
4026
4027
4027
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.
4028
4028
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`.
4030
4030
4031
4031
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.
4032
4032
@@ -4537,7 +4537,7 @@ That is, they will take Lua boolean values `true`. However, they are different f
4537
4537
4538
4538
Empty key arguments are discarded. `POST /test` with body `=hello&=world` will yield empty outputs for instance.
4539
4539
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.
4541
4541
4542
4542
However, the optional `max_args` function argument can be used to override this limit:
4543
4543
@@ -4598,7 +4598,7 @@ the value of `ngx.req.get_headers()["Foo"]` will be a Lua (array) table such as:
4598
4598
{"foo", "bar", "baz"}
4599
4599
```
4600
4600
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.
4602
4602
4603
4603
However, the optional `max_headers` function argument can be used to override this limit:
4604
4604
@@ -6007,7 +6007,7 @@ When the `replace` is a string, then it is treated as a special template for str
6007
6007
6008
6008
where `$0` referring to the whole substring matched by the pattern and `$1` referring to the first parenthesized capturing substring.
6009
6009
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:
0 commit comments