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
@@ -1832,6 +1833,10 @@ As with other access phase handlers, [access_by_lua](#access_by_lua) will *not*
1832
1833
1833
1834
Note that when calling `ngx.exit(ngx.OK)` within a [access_by_lua](#access_by_lua) handler, the nginx request processing control flow will still continue to the content handler. To terminate the current request from within a [access_by_lua](#access_by_lua) handler, calling [ngx.exit](#ngxexit) with status >= 200 (`ngx.HTTP_OK`) and status < 300 (`ngx.HTTP_SPECIAL_RESPONSE`) for successful quits and `ngx.exit(ngx.HTTP_INTERNAL_SERVER_ERROR)` (or its friends) for failures.
1834
1835
1836
+
Starting from the `v0.9.20` release, you can use the [access_by_lua_no_postpone](#access_by_lua_no_postpone)
1837
+
directive to control when to run this handler inside the "access" request-processing phase
1838
+
of NGINX.
1839
+
1835
1840
[Back to TOC](#directives)
1836
1841
1837
1842
access_by_lua_block
@@ -2265,6 +2270,9 @@ The `<size>` argument accepts size units such as `k` and `m`:
2265
2270
}
2266
2271
```
2267
2272
2273
+
The hard-coded minimum size is 8KB while the practical minimum size depends
2274
+
on actual user data set (some people start with 12KB).
2275
+
2268
2276
See [ngx.shared.DICT](#ngxshareddict) for details.
2269
2277
2270
2278
This directive was first introduced in the `v0.3.1rc22` release.
Controls whether or not to disable postponing [rewrite_by_lua](#rewrite_by_lua) and [rewrite_by_lua_file](#rewrite_by_lua_file) directives to run at the end of the `rewrite` request-processing phase. By default, this directive is turned off and the Lua code is postponed to run at the end of the `rewrite` phase.
2529
+
Controls whether or not to disable postponing [rewrite_by_lua](#rewrite_by_lua)* directives to run at the end of the `rewrite` request-processing phase. By default, this directive is turned off and the Lua code is postponed to run at the end of the `rewrite` phase.
2522
2530
2523
2531
This directive was first introduced in the `v0.5.0rc29` release.
2524
2532
2525
2533
[Back to TOC](#directives)
2526
2534
2535
+
access_by_lua_no_postpone
2536
+
-------------------------
2537
+
2538
+
**syntax:***access_by_lua_no_postpone on|off*
2539
+
2540
+
**default:***access_by_lua_no_postpone off*
2541
+
2542
+
**context:***http*
2543
+
2544
+
Controls whether or not to disable postponing [access_by_lua](#access_by_lua)* directives to run at the end of the `access` request-processing phase. By default, this directive is turned off and the Lua code is postponed to run at the end of the `access` phase.
2545
+
2546
+
This directive was first introduced in the `v0.9.20` release.
Issue a synchronous but still non-blocking *Nginx Subrequest* using `uri`.
3162
+
Issues a synchronous but still non-blocking *Nginx Subrequest* using `uri`.
3118
3163
3119
3164
Nginx's subrequests provide a powerful way to make non-blocking internal requests to other locations configured with disk file directory or *any* other nginx C modules like `ngx_proxy`, `ngx_fastcgi`, `ngx_memc`,
3120
3165
`ngx_postgres`, `ngx_drizzle`, and even ngx_lua itself and etc etc etc.
@@ -3125,6 +3170,9 @@ Subrequests are completely different from HTTP 301/302 redirection (via [ngx.red
3125
3170
3126
3171
You should always read the request body (by either calling [ngx.req.read_body](#ngxreqread_body) or configuring [lua_need_request_body](#lua_need_request_body) on) before initiating a subrequest.
3127
3172
3173
+
This API function (as well as [ngx.location.capture_multi](#ngxlocationcapture_multi)) always buffers the whole response body of the subrequest in memory. Thus, you should use [cosockets](#ngxsockettcp)
3174
+
and streaming processing instead if you have to handle large subrequest responses.
3175
+
3128
3176
Here is a basic example:
3129
3177
3130
3178
```lua
@@ -3619,6 +3667,21 @@ This API was first introduced in the `v0.9.5` release.
Returns a boolean indicating whether the current request is an "internal request", i.e.,
3677
+
a request initiated from inside the current nginx server instead of from the client side.
3678
+
3679
+
Subrequests are all internal requests and so are requests after internal redirects.
3680
+
3681
+
This API was first introduced in the `v0.9.20` release.
3682
+
3683
+
[Back to TOC](#nginx-api-for-lua)
3684
+
3622
3685
ngx.req.start_time
3623
3686
------------------
3624
3687
**syntax:***secs = ngx.req.start_time()*
@@ -5732,7 +5795,7 @@ Unconditionally sets a key-value pair into the shm-based dictionary [ngx.shared.
5732
5795
5733
5796
The `value` argument inserted can be Lua booleans, numbers, strings, or `nil`. Their value type will also be stored into the dictionary and the same data type can be retrieved later via the [get](#ngxshareddictget) method.
5734
5797
5735
-
The optional `exptime` argument specifies expiration time (in seconds) for the inserted key-value pair. The time resolution is `0.001` seconds. If the `exptime` takes the value `0` (which is the default), then the item will never be expired.
5798
+
The optional `exptime` argument specifies expiration time (in seconds) for the inserted key-value pair. The time resolution is `0.001` seconds. If the `exptime` takes the value `0` (which is the default), then the item will never expire.
5736
5799
5737
5800
The optional `flags` argument specifies a user flags value associated with the entry to be stored. It can also be retrieved later with the value. The user flags is stored as an unsigned 32-bit integer internally. Defaults to `0`. The user flags argument was first introduced in the `v0.5.0rc2` release.
5738
5801
@@ -6976,6 +7039,30 @@ This API was first introduced in the `v0.8.0` release.
0 commit comments