Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
openresty
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
tangku7
openresty
Commits
3be52cb0
Commit
3be52cb0
authored
Jul 25, 2018
by
周尚
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化数据同步接口 [完成]
parent
2b5305ba
Changes
27
Show whitespace changes
Inline
Side-by-side
Showing
27 changed files
with
1966 additions
and
736 deletions
+1966
-736
luajit/lib/libluajit-5.1.2.1.0.dylib
luajit/lib/libluajit-5.1.2.1.0.dylib
+0
-0
luajit/lib/libluajit-5.1.a
luajit/lib/libluajit-5.1.a
+0
-0
lualib/cjson.so
lualib/cjson.so
+0
-0
lualib/rds/parser.so
lualib/rds/parser.so
+0
-0
lualib/redis/parser.so
lualib/redis/parser.so
+0
-0
nginx/conf/nginx.conf
nginx/conf/nginx.conf
+9
-1
nginx/lua/luabiz/sync.lua
nginx/lua/luabiz/sync.lua
+5
-0
nginx/lua/luabiz/tk_casher.lua
nginx/lua/luabiz/tk_casher.lua
+0
-151
nginx/lua/luabiz/tk_sync.lua
nginx/lua/luabiz/tk_sync.lua
+186
-0
nginx/lua/luainit/init.lua
nginx/lua/luainit/init.lua
+2
-2
pod/nginx/control.pod
pod/nginx/control.pod
+3
-3
pod/nginx/example.pod
pod/nginx/example.pod
+1
-1
pod/nginx/ngx_http_core_module.pod
pod/nginx/ngx_http_core_module.pod
+6
-3
pod/nginx/ngx_http_fastcgi_module.pod
pod/nginx/ngx_http_fastcgi_module.pod
+1
-1
pod/nginx/ngx_http_hls_module.pod
pod/nginx/ngx_http_hls_module.pod
+2
-2
pod/nginx/ngx_http_js_module.pod
pod/nginx/ngx_http_js_module.pod
+53
-61
pod/nginx/ngx_http_mirror_module.pod
pod/nginx/ngx_http_mirror_module.pod
+2
-2
pod/nginx/ngx_http_ssi_module.pod
pod/nginx/ngx_http_ssi_module.pod
+1
-1
pod/nginx/ngx_http_stub_status_module.pod
pod/nginx/ngx_http_stub_status_module.pod
+1
-1
pod/nginx/ngx_http_upstream_module.pod
pod/nginx/ngx_http_upstream_module.pod
+40
-0
pod/nginx/ngx_stream_core_module.pod
pod/nginx/ngx_stream_core_module.pod
+5
-2
pod/nginx/ngx_stream_js_module.pod
pod/nginx/ngx_stream_js_module.pod
+6
-23
pod/nginx/ngx_stream_ssl_preread_module.pod
pod/nginx/ngx_stream_ssl_preread_module.pod
+31
-0
pod/nginx/ngx_stream_upstream_module.pod
pod/nginx/ngx_stream_upstream_module.pod
+47
-3
pod/nginx/njs_api.pod
pod/nginx/njs_api.pod
+943
-124
pod/nginx/njs_changes.pod
pod/nginx/njs_changes.pod
+230
-0
resty.index
resty.index
+392
-355
No files found.
luajit/lib/libluajit-5.1.2.1.0.dylib
View file @
3be52cb0
No preview for this file type
luajit/lib/libluajit-5.1.a
View file @
3be52cb0
No preview for this file type
lualib/cjson.so
View file @
3be52cb0
No preview for this file type
lualib/rds/parser.so
View file @
3be52cb0
No preview for this file type
lualib/redis/parser.so
View file @
3be52cb0
No preview for this file type
nginx/conf/nginx.conf
View file @
3be52cb0
...
@@ -33,6 +33,7 @@ http {
...
@@ -33,6 +33,7 @@ http {
lua_package_path
"/Users/zhoush/openresty/nginx/lua/luabiz/?.lua
;
;
"
;
init_by_lua_file
"lua/luainit/init.lua"
;
init_by_lua_file
"lua/luainit/init.lua"
;
# init_worker_by_lua_file "luabiz/settle/settle.lua";
# init_worker_by_lua_file "luabiz/settle/settle.lua";
...
@@ -48,7 +49,7 @@ http {
...
@@ -48,7 +49,7 @@ http {
# ssl_ciphers HIGH:!aNULL:!MD5;
# ssl_ciphers HIGH:!aNULL:!MD5;
# ssl_prefer_server_ciphers on;
# ssl_prefer_server_ciphers on;
set
$server_dir
/Users/zhoush/openresty
/
;
set
$server_dir
/Users/zhoush/openresty
;
# set $lua_dir lua/;
# set $lua_dir lua/;
set
$biz_dir
lua/luabiz
;
set
$biz_dir
lua/luabiz
;
set
$logs_path
$server_dir
/nginx/logs
;
set
$logs_path
$server_dir
/nginx/logs
;
...
@@ -78,6 +79,13 @@ http {
...
@@ -78,6 +79,13 @@ http {
}
}
}
}
location
/table_sync
{
content_by_lua_block
{
local
tk_sync
=
loadmod("tk_sync")
tk_sync:sync()
}
}
location
/echo
{
location
/echo
{
content_by_lua_block
{
content_by_lua_block
{
...
...
nginx/lua/luabiz/sync.lua
View file @
3be52cb0
...
@@ -150,6 +150,11 @@ local function main()
...
@@ -150,6 +150,11 @@ local function main()
local
str
=
""
local
str
=
""
local
resp
=
{}
local
resp
=
{}
if
ngx
.
req
.
get_method
()
~=
"POST"
then
return
sync_err_tell
(
resp
,
"03"
,
"Invalid Method"
)
end
local
req
=
json
.
decode
(
ngx
.
var
.
request_body
)
local
req
=
json
.
decode
(
ngx
.
var
.
request_body
)
ok
,
err
,
msg
,
str
=
sync_bizz_switch
(
req
)
ok
,
err
,
msg
,
str
=
sync_bizz_switch
(
req
)
...
...
nginx/lua/luabiz/tk_casher.lua
deleted
100644 → 0
View file @
2b5305ba
local
_CASHER
=
{}
local
MODULE
=
"S"
-- Settle
-- 加载模块
local
mysql
=
loadmod
(
"resty.mysql"
)
local
zx_base
=
loadmod
(
"zx_base"
)
local
json
=
loadmod
(
'cjson'
)
local
db_conf
=
"tk7_dbs.json"
-- 协和组
local
tasks
=
{}
local
function
EOF
()
zx_base
:
log
(
MODULE
,
"-----------------------> END[TK_CASHER]"
)
ngx
.
eof
()
end
-- 门店信息
-- @param table tk_biz 节点机数据库对象
-- table tk_control 总控机数据库对象
-- @return nil
local
function
casher_sql
(
tk_biz
,
tk_control
)
zx_base
:
log
(
MODULE
,
"-----------------------> START[TK_CASHER]"
)
-- 新建mysql连接
local
db
,
err
=
mysql
:
new
()
if
not
db
then
zx_base
:
log
(
MODULE
,
"[TK_CASHER]"
,
"failed to instantiate mysql: "
,
err
)
return
false
end
-- 连接节点机MySQL
local
ok
,
err
,
errcode
,
sqlstate
=
db
:
connect
{
host
=
tk_biz
[
'host'
],
port
=
tk_biz
[
'port'
],
database
=
tk_biz
[
'database'
],
user
=
tk_biz
[
'user'
],
password
=
tk_biz
[
'password'
],
timeout
=
tk_biz
[
'timeout'
],
charset
=
'utf8'
}
if
not
ok
then
zx_base
:
log
(
MODULE
,
"[TK_CASHER]"
,
"failed to connect:"
,
json
.
encode
(
tk_biz
),
":"
,
err
,
":"
,
errcode
,
sqlstate
)
return
end
-- 查询节点机
local
sql
=
string.format
(
[[SELECT * FROM tk_casher where update_time > %s]]
,
-- os.date("%Y%m%d000000", os.time()-24*60*60)
"20180716000000"
)
local
cashers
cashers
,
err
,
errcode
,
sqlstate
=
db
:
query
(
sql
)
if
not
cashers
then
zx_base
:
log
(
MODULE
,
"[TK_CASHER]"
,
sql
)
zx_base
:
log
(
MODULE
,
"[TK_CASHER]"
,
"failed to query:"
,
json
.
encode
(
tk_biz
),
":"
,
err
,
":"
,
errcode
,
":"
,
sqlstate
,
"."
)
return
end
if
#
cashers
==
0
then
ngx
.
say
(
"no cashers found"
)
ngx
.
eof
()
return
end
-- 重置MySQL连接
zx_base
:
close_db
(
db
)
db
,
err
=
mysql
:
new
()
if
not
db
then
zx_base
:
log
(
MODULE
,
"[TK_CASHER]"
,
"failed to instantiate mysql: "
,
err
)
return
false
end
-- 连接总控机MySQL
ok
,
err
,
errcode
,
sqlstate
=
db
:
connect
{
host
=
tk_control
[
'host'
],
port
=
tk_control
[
'port'
],
database
=
tk_control
[
'database'
],
user
=
tk_control
[
'user'
],
password
=
tk_control
[
'password'
],
timeout
=
tk_control
[
'timeout'
],
charset
=
'utf8'
}
if
not
ok
then
zx_base
:
log
(
MODULE
,
"[TK_CASHER]"
,
"failed to connect:"
,
json
.
encode
(
tk_biz
),
":"
,
errcode
,
sqlstate
)
return
end
-- 插入总控机
for
i
=
1
,
#
cashers
do
local
casher
=
cashers
[
i
]
local
sql_result
=
zx_base
:
sql_concate
(
"duplicate"
,
"tk_casher"
,
casher
)
ok
,
err
,
errcode
,
sqlstate
=
db
:
query
(
sql_result
)
if
not
ok
then
zx_base
:
log
(
MODULE
,
"[TK_CASHER]"
,
sql_result
)
zx_base
:
log
(
MODULE
,
"[TK_CASHER]"
,
"failed to query:"
,
json
.
encode
(
tk_control
),
":"
,
err
,
":"
,
errcode
,
":"
,
sqlstate
,
"."
)
end
end
ngx
.
say
(
"SUCCESS"
)
EOF
()
end
local
function
async
(
tk_biz
,
tk_control
)
local
co
=
coroutine.wrap
(
function
()
casher_sql
(
tk_biz
,
tk_control
)
end
)
table.insert
(
tasks
,
co
)
end
local
function
dispatch
()
local
i
=
1
while
true
do
if
tasks
[
i
]
==
nil
then
if
tasks
[
1
]
==
nil
then
break
end
i
=
1
end
local
res
=
tasks
[
i
]()
if
not
res
then
table.remove
(
tasks
,
i
)
else
i
=
i
+
1
end
end
end
function
_CASHER
.
run
()
local
dbs_st
=
zx_base
:
db_read
(
db_conf
)
for
i
=
1
,
#
dbs_st
.
tk_biz
do
async
(
dbs_st
.
tk_biz
[
i
],
dbs_st
.
tk_control
)
end
dispatch
()
end
return
_CASHER
nginx/lua/luabiz/tk_s
hop
.lua
→
nginx/lua/luabiz/tk_s
ync
.lua
View file @
3be52cb0
local
_SHOP
=
{}
local
TK_SYNC
=
{}
local
MODULE
=
"S"
-- Settle
local
MODULE
=
"S"
-- Settle
...
@@ -14,57 +14,58 @@ local tasks = {}
...
@@ -14,57 +14,58 @@ local tasks = {}
local
function
EOF
()
local
function
EOF
()
zx_base
:
log
(
MODULE
,
"-----------------------> END[TK_S
HOP
]"
)
zx_base
:
log
(
MODULE
,
"-----------------------> END[TK_S
YNC
]"
)
ngx
.
eof
()
ngx
.
eof
()
end
end
--
门店
信息
--
表
信息
-- @param table tk_biz 节点机数据库对象
-- @param table tk_biz 节点机数据库对象
-- table tk_control 总控机数据库对象
-- table tk_control 总控机数据库对象
-- @return nil
-- @return nil
local
function
s
hop_sql
(
tk_biz
,
tk_control
)
local
function
s
ync_sql
(
tk_biz
,
tk_control
,
tk_table
,
tk_database
)
zx_base
:
log
(
MODULE
,
"-----------------------> START[TK_S
HOP
]"
)
zx_base
:
log
(
MODULE
,
"-----------------------> START[TK_S
YNC
]"
)
-- 新建mysql连接
-- 新建mysql连接
local
db
,
err
=
mysql
:
new
()
local
db
,
err
=
mysql
:
new
()
if
not
db
then
if
not
db
then
zx_base
:
log
(
MODULE
,
"[TK_S
HOP
]"
,
"failed to instantiate mysql: "
,
err
)
zx_base
:
log
(
MODULE
,
"[TK_S
YNC
]"
,
"failed to instantiate mysql: "
,
err
)
return
false
return
false
end
end
-- 连接节点机MySQL
-- 连接节点机MySQL
local
ok
,
err
,
errcode
,
sqlstate
=
db
:
connect
{
local
ok
,
err
,
errcode
,
sqlstate
=
db
:
connect
{
host
=
tk_biz
[
'host'
],
host
=
tk_biz
[
'host'
],
port
=
tk_biz
[
'port'
],
port
=
tk_biz
[
'port'
],
database
=
tk_
biz
[
'database'
]
,
database
=
tk_
database
,
user
=
tk_biz
[
'user'
],
user
=
tk_biz
[
'user'
],
password
=
tk_biz
[
'password'
],
password
=
tk_biz
[
'password'
],
timeout
=
tk_biz
[
'timeout'
],
timeout
=
tk_biz
[
'timeout'
],
charset
=
'utf8'
charset
=
'utf8'
}
}
if
not
ok
then
if
not
ok
then
zx_base
:
log
(
MODULE
,
"[TK_S
HOP
]"
,
"failed to connect:"
,
json
.
encode
(
tk_biz
),
":"
,
zx_base
:
log
(
MODULE
,
"[TK_S
YNC
]"
,
"failed to connect:"
,
json
.
encode
(
tk_biz
),
":"
,
err
,
":"
,
errcode
,
sqlstate
)
err
,
":"
,
errcode
,
sqlstate
)
return
return
end
end
-- 查询节点机
-- 查询节点机
local
sql
=
string.format
(
[[SELECT * FROM
tk_shop
where update_time > %s]]
,
local
sql
=
string.format
(
[[SELECT * FROM
%s
where update_time > %s]]
,
-- os.date("%Y%m%d000000", os.time()-24*60*60)
-- os.date("%Y%m%d000000", os.time()-24*60*60)
tk_table
,
"20180716000000"
"20180716000000"
)
)
local
s
hop
s
local
s
ync
s
s
hop
s
,
err
,
errcode
,
sqlstate
=
db
:
query
(
sql
)
s
ync
s
,
err
,
errcode
,
sqlstate
=
db
:
query
(
sql
)
if
not
s
hop
s
then
if
not
s
ync
s
then
zx_base
:
log
(
MODULE
,
"[TK_S
HOP
]"
,
sql
)
zx_base
:
log
(
MODULE
,
"[TK_S
YNC
]"
,
sql
)
zx_base
:
log
(
MODULE
,
"[TK_S
HOP
]"
,
"failed to query:"
,
json
.
encode
(
tk_biz
),
":"
,
zx_base
:
log
(
MODULE
,
"[TK_S
YNC
]"
,
"failed to query:"
,
json
.
encode
(
tk_biz
),
":"
,
err
,
":"
,
errcode
,
":"
,
sqlstate
,
"."
)
err
,
":"
,
errcode
,
":"
,
sqlstate
,
"."
)
return
return
end
end
if
#
s
hop
s
==
0
then
if
#
s
ync
s
==
0
then
ngx
.
say
(
"no s
hop
s found"
)
ngx
.
say
(
"no s
ync
s found"
)
ngx
.
eof
()
ngx
.
eof
()
return
return
end
end
...
@@ -75,7 +76,7 @@ local function shop_sql(tk_biz, tk_control)
...
@@ -75,7 +76,7 @@ local function shop_sql(tk_biz, tk_control)
zx_base
:
close_db
(
db
)
zx_base
:
close_db
(
db
)
db
,
err
=
mysql
:
new
()
db
,
err
=
mysql
:
new
()
if
not
db
then
if
not
db
then
zx_base
:
log
(
MODULE
,
"[TK_S
HOP
]"
,
"failed to instantiate mysql: "
,
err
)
zx_base
:
log
(
MODULE
,
"[TK_S
YNC
]"
,
"failed to instantiate mysql: "
,
err
)
return
false
return
false
end
end
-- 连接总控机MySQL
-- 连接总控机MySQL
...
@@ -89,20 +90,20 @@ local function shop_sql(tk_biz, tk_control)
...
@@ -89,20 +90,20 @@ local function shop_sql(tk_biz, tk_control)
charset
=
'utf8'
charset
=
'utf8'
}
}
if
not
ok
then
if
not
ok
then
zx_base
:
log
(
MODULE
,
"[TK_S
HOP
]"
,
"failed to connect:"
,
json
.
encode
(
tk_biz
),
":"
,
errcode
,
sqlstate
)
zx_base
:
log
(
MODULE
,
"[TK_S
YNC
]"
,
"failed to connect:"
,
json
.
encode
(
tk_biz
),
":"
,
errcode
,
sqlstate
)
return
return
end
end
-- 插入总控机
-- 插入总控机
for
i
=
1
,
#
s
hop
s
do
for
i
=
1
,
#
s
ync
s
do
local
s
hop
=
shop
s
[
i
]
local
s
ync
=
sync
s
[
i
]
local
sql_result
=
zx_base
:
sql_concate
(
"duplicate"
,
"tk_shop"
,
shop
)
local
sql_result
=
zx_base
:
sql_concate
(
"duplicate"
,
tk_table
,
sync
)
ok
,
err
,
errcode
,
sqlstate
=
db
:
query
(
sql_result
)
ok
,
err
,
errcode
,
sqlstate
=
db
:
query
(
sql_result
)
if
not
ok
then
if
not
ok
then
zx_base
:
log
(
MODULE
,
"[TK_S
HOP
]"
,
sql_result
)
zx_base
:
log
(
MODULE
,
"[TK_S
YNC
]"
,
sql_result
)
zx_base
:
log
(
MODULE
,
"[TK_S
HOP
]"
,
"failed to query:"
,
json
.
encode
(
tk_control
),
":"
,
zx_base
:
log
(
MODULE
,
"[TK_S
YNC
]"
,
"failed to query:"
,
json
.
encode
(
tk_control
),
":"
,
err
,
":"
,
errcode
,
":"
,
sqlstate
,
"."
)
err
,
":"
,
errcode
,
":"
,
sqlstate
,
"."
)
end
end
end
end
...
@@ -112,10 +113,10 @@ local function shop_sql(tk_biz, tk_control)
...
@@ -112,10 +113,10 @@ local function shop_sql(tk_biz, tk_control)
end
end
local
function
async
(
tk_biz
,
tk_control
)
local
function
async
(
tk_biz
,
tk_control
,
tk_database
,
tk_table
)
local
co
=
coroutine.wrap
(
local
co
=
coroutine.wrap
(
function
()
function
()
s
hop_sql
(
tk_biz
,
tk_control
)
s
ync_sql
(
tk_biz
,
tk_control
,
tk_database
,
tk_table
)
end
end
)
)
table.insert
(
tasks
,
co
)
table.insert
(
tasks
,
co
)
...
@@ -140,12 +141,46 @@ local function dispatch()
...
@@ -140,12 +141,46 @@ local function dispatch()
end
end
end
end
function
_SHOP
.
run
()
function
TK_SYNC
.
run
()
local
dbs_st
=
zx_base
:
db_read
(
db_conf
)
local
dbs_st
=
zx_base
:
db_read
(
db_conf
)
for
i
=
1
,
#
dbs_st
.
tk_biz
do
for
i
=
1
,
#
dbs_st
.
tk_biz
do
async
(
dbs_st
.
tk_biz
[
i
],
dbs_st
.
tk_control
)
async
(
dbs_st
.
tk_biz
[
i
],
dbs_st
.
tk_control
,
dbs_st
.
tk_biz
[
i
].
database
,
"tk_shop"
)
async
(
dbs_st
.
tk_biz
[
i
],
dbs_st
.
tk_control
,
dbs_st
.
tk_biz
[
i
].
database
,
"tk_casher"
)
end
end
dispatch
()
dispatch
()
end
end
return
_SHOP
function
TK_SYNC
.
sync
()
local
dbs_st
=
zx_base
:
db_read
(
db_conf
)
if
ngx
.
req
.
get_method
()
~=
"POST"
then
ngx
.
say
(
json
.
encode
({
mesgRetCode
=
"A7"
,
mesgRetDesc
=
"invalid method"
}))
else
local
data
=
json
.
decode
(
ngx
.
var
.
request_body
)
if
data
.
mesgType
~=
"table_sync"
then
ngx
.
say
(
json
.
encode
({
mesgRetcode
=
"N1"
,
mesgRetDesc
=
"mesgType invalid"
}))
elseif
data
.
dbHost
==
ngx
.
null
then
ngx
.
say
(
json
.
encode
({
mesgRetCode
=
"N0"
,
mesgRetDesc
=
"dbHost missing"
}))
else
for
i
=
1
,
#
dbs_st
.
tk_biz
do
if
dbs_st
.
tk_biz
[
i
].
host
==
data
.
dbHost
then
if
data
.
dbTable
==
ngx
.
null
then
ngx
.
say
(
json
.
encode
({
mesgRetCode
=
"N0"
,
mesgRetDesc
=
"dbTable missing"
}))
else
async
(
dbs_st
.
tk_biz
[
i
],
dbs_st
.
tk_control
,
dbs_st
.
tk_biz
[
i
].
database
,
data
.
dbTable
)
return
ngx
.
say
(
json
.
encode
({
mesgRetCode
=
"00"
,
mesgRetDesc
=
"SUCCESS"
}))
end
end
end
ngx
.
say
(
json
.
encode
({
mesgRetCode
=
"N1"
,
mesgRetDesc
=
"dbHost invalid"
}))
end
end
ngx
.
eof
()
end
return
TK_SYNC
nginx/lua/luainit/init.lua
View file @
3be52cb0
...
@@ -10,7 +10,6 @@ local __loaded_mods = {}
...
@@ -10,7 +10,6 @@ local __loaded_mods = {}
-- @param string namespace 模块名
-- @param string namespace 模块名
-- @return table 模块
-- @return table 模块
function
_G
.
loadmod
(
namespace
)
function
_G
.
loadmod
(
namespace
)
package.path
=
package.path
..
string.format
(
";nginx/%s/?.lua;;"
,
ngx
.
var
.
biz_dir
)
-- 查找系统模块
-- 查找系统模块
local
module
=
__loaded_mods
[
namespace
]
local
module
=
__loaded_mods
[
namespace
]
...
@@ -19,7 +18,8 @@ function _G.loadmod(namespace)
...
@@ -19,7 +18,8 @@ function _G.loadmod(namespace)
end
end
-- 查找项目模块
-- 查找项目模块
local
p_namespace
=
ngx
.
var
.
biz_dir
..
'.'
..
namespace
-- local p_namespace = ngx.var.biz_dir .. '.' .. namespace
local
p_namespace
=
namespace
local
p_module
=
__loaded_mods
[
p_namespace
]
local
p_module
=
__loaded_mods
[
p_namespace
]
if
p_module
then
if
p_module
then
return
p_module
return
p_module
...
...
pod/nginx/control.pod
View file @
3be52cb0
...
@@ -74,7 +74,7 @@ After all clients are serviced, old worker processes are shut down.
...
@@ -74,7 +74,7 @@ After all clients are serviced, old worker processes are shut down.
Let’s illustrate this by example.
Let’s illustrate this by example.
Imagine that nginx is run on FreeBSD
4.x
and the command
Imagine that nginx is run on FreeBSD and the command
ps axw -o pid,ppid,user,%cpu,vsz,wchan,command | egrep '(nginx|PID)'
ps axw -o pid,ppid,user,%cpu,vsz,wchan,command | egrep '(nginx|PID)'
...
@@ -264,8 +264,8 @@ the F<.oldbin> suffix from the file name with the process ID.
...
@@ -264,8 +264,8 @@ the F<.oldbin> suffix from the file name with the process ID.
If upgrade was successful, then the
old master process should be sent
If upgrade was successful, then the
QUIT signal should be sent to
the
QUIT signal
, and only new processes will stay:
the
old master process
, and only new processes will stay:
PID PPID USER %CPU VSZ WCHAN COMMAND
PID PPID USER %CPU VSZ WCHAN COMMAND
...
...
pod/nginx/example.pod
View file @
3be52cb0
...
@@ -115,7 +115,7 @@ images and requests starting with "E<sol>downloadE<sol>".
...
@@ -115,7 +115,7 @@ images and requests starting with "E<sol>downloadE<sol>".
error_page 404 /404.html;
error_page 404 /404.html;
location /404.html {
location
=
/404.html {
root /spool/www;
root /spool/www;
}
}
...
...
pod/nginx/ngx_http_core_module.pod
View file @
3be52cb0
...
@@ -1342,7 +1342,7 @@ Example:
...
@@ -1342,7 +1342,7 @@ Example:
error_page 404 /404.html;
error_page 404 /404.html;
location /404.html {
location
=
/404.html {
internal;
internal;
}
}
...
@@ -2197,9 +2197,12 @@ C<reuseport>
...
@@ -2197,9 +2197,12 @@ C<reuseport>
this parameter (1.9.1) instructs to create an individual listening socket
this parameter (1.9.1) instructs to create an individual listening socket
for each worker process
for each worker process
(using the C
<SO
_REUSEPORT
>
socket option), allowing a kernel
(using the
C
<SO
_REUSEPORT
>
socket option on Linux 3.9+ and DragonFly BSD,
or C
<SO
_REUSEPORT_LB
>
on FreeBSDE
<nbsp>
12+), allowing a kernel
to distribute incoming connections between worker processes.
to distribute incoming connections between worker processes.
This currently works only on Linux 3.9+ and DragonFly BSD.
This currently works only on Linux 3.9+, DragonFly BSD,
and FreeBSD 12+ (1.15.1).
B
<NOTE>
B
<NOTE>
...
...
pod/nginx/ngx_http_fastcgi_module.pod
View file @
3be52cb0
...
@@ -1221,7 +1221,7 @@ server has returned an invalid response.
...
@@ -1221,7 +1221,7 @@ server has returned an invalid response.
This allows handling application errors in nginx, for example:
This allows handling application errors in nginx, for example:
location /php {
location /php
/
{
fastcgi_pass backend:9000;
fastcgi_pass backend:9000;
...
...
fastcgi_catch_stderr "PHP Fatal error";
fastcgi_catch_stderr "PHP Fatal error";
...
...
pod/nginx/ngx_http_hls_module.pod
View file @
3be52cb0
...
@@ -278,11 +278,11 @@ instead of C<$uri>
...
@@ -278,11 +278,11 @@ instead of C<$uri>
server {
server {
...
...
location /hls {
location /hls
/
{
hls;
hls;
hls_forward_args on;
hls_forward_args on;
alias /var/videos;
alias /var/videos
/
;
secure_link $arg_md5,$arg_expires;
secure_link $arg_md5,$arg_expires;
secure_link_md5 "$secure_link_expires$hls_uri$remote_addr secret";
secure_link_md5 "$secure_link_expires$hls_uri$remote_addr secret";
...
...
pod/nginx/ngx_http_js_module.pod
View file @
3be52cb0
...
@@ -20,29 +20,9 @@ a subset of the JavaScript language.
...
@@ -20,29 +20,9 @@ a subset of the JavaScript language.
This module is not built by default, it should be compiled with
This module is not built by default.
the njs module using the
Download and install instructions are available
C<--add-module> configuration parameter:
L<here|njs_about>.
./configure --add-module=<value>path-to-njs</value>/nginx
The L<repository|http://hg.nginx.org/njs>
with the njs module can be cloned with the following command
(requires L<Mercurial|https://www.mercurial-scm.org> client):
hg clone http://hg.nginx.org/njs
This module can also be built as
L<dynamic|ngx_core_module>:
./configure --add-dynamic-module=<value>path-to-njs</value>/nginx
...
@@ -53,6 +33,10 @@ L<dynamic|ngx_core_module>:
...
@@ -53,6 +33,10 @@ L<dynamic|ngx_core_module>:
load_module modules/ngx_http_js_module.so;
...
http {
js_include http.js;
js_include http.js;
js_set $foo foo;
js_set $foo foo;
...
@@ -66,9 +50,14 @@ L<dynamic|ngx_core_module>:
...
@@ -66,9 +50,14 @@ L<dynamic|ngx_core_module>:
js_content baz;
js_content baz;
}
}
location
/summary {
location =
/summary {
return 200 $summary;
return 200 $summary;
}
}
location = /hello {
js_content hello;
}
}
}
}
...
@@ -80,46 +69,50 @@ L<dynamic|ngx_core_module>:
...
@@ -80,46 +69,50 @@ L<dynamic|ngx_core_module>:
The F<http.js> file:
The F<http.js> file:
function foo(r
eq, res
) {
function foo(r) {
r
eq
.log("hello from foo() handler");
r.log("hello from foo() handler");
return "foo";
return "foo";
}
}
function summary(r
eq, res
) {
function summary(r) {
var a, s, h;
var a, s, h;
s = "JS summary\n\n";
s = "JS summary\n\n";
s += "Method: " + r
eq
.method + "\n";
s += "Method: " + r.method + "\n";
s += "HTTP version: " + r
eq
.httpVersion + "\n";
s += "HTTP version: " + r.httpVersion + "\n";
s += "Host: " + r
eq.headers
.host + "\n";
s += "Host: " + r
.headersIn
.host + "\n";
s += "Remote Address: " + r
eq
.remoteAddress + "\n";
s += "Remote Address: " + r.remoteAddress + "\n";
s += "URI: " + r
eq
.uri + "\n";
s += "URI: " + r.uri + "\n";
s += "Headers:\n";
s += "Headers:\n";
for (h in r
eq.headers
) {
for (h in r
.headersIn
) {
s += " header '" + h + "' is '" + r
eq.headers
[h] + "'\n";
s += " header '" + h + "' is '" + r
.headersIn
[h] + "'\n";
}
}
s += "Args:\n";
s += "Args:\n";
for (a in r
eq
.args) {
for (a in r.args) {
s += " arg '" + a + "' is '" + r
eq
.args[a] + "'\n";
s += " arg '" + a + "' is '" + r.args[a] + "'\n";
}
}
return s;
return s;
}
}
function baz(req, res) {
function baz(r) {
res.headers.foo = 1234;
r.status = 200;
res.status = 200;
r.headersOut.foo = 1234;
res.contentType = "text/plain; charset=utf-8";
r.headersOut['Content-Type'] = "text/plain; charset=utf-8";
res.contentLength = 15;
r.headersOut['Content-Length'] = 15;
res.sendHeader();
r.sendHeader();
res.send("nginx");
r.send("nginx");
res.send("java");
r.send("java");
res.send("script");
r.send("script");
res.finish();
r.finish();
}
function hello(r) {
r.return(200, "Hello world!");
}
}
...
@@ -196,13 +189,12 @@ Sets an njs function for the specified variable.
...
@@ -196,13 +189,12 @@ Sets an njs function for the specified variable.
=head1 Request
and Response Arguments
=head1 Request
Argument
Each HTTP njs handler receives two arguments,
Each HTTP njs handler receives one argument, a request
L<request|njs_api>
L<object|njs_api>.
and L<response|njs_api>.
...
...
pod/nginx/ngx_http_mirror_module.pod
View file @
3be52cb0
...
@@ -30,7 +30,7 @@ Responses to mirror subrequests are ignored.
...
@@ -30,7 +30,7 @@ Responses to mirror subrequests are ignored.
proxy_pass http://backend;
proxy_pass http://backend;
}
}
location /mirror {
location
=
/mirror {
internal;
internal;
proxy_pass http://test_backend$request_uri;
proxy_pass http://test_backend$request_uri;
}
}
...
@@ -112,7 +112,7 @@ directives will be disabled.
...
@@ -112,7 +112,7 @@ directives will be disabled.
proxy_pass http://backend;
proxy_pass http://backend;
}
}
location /mirror {
location
=
/mirror {
internal;
internal;
proxy_pass http://log_backend;
proxy_pass http://log_backend;
proxy_pass_request_body off;
proxy_pass_request_body off;
...
...
pod/nginx/ngx_http_ssi_module.pod
View file @
3be52cb0
...
@@ -606,7 +606,7 @@ L<ngx_http_core_module>
...
@@ -606,7 +606,7 @@ L<ngx_http_core_module>
directive (1.13.10):
directive (1.13.10):
location /remote {
location /remote
/
{
subrequest_output_buffer_size 64k;
subrequest_output_buffer_size 64k;
...
...
}
}
...
...
pod/nginx/ngx_http_stub_status_module.pod
View file @
3be52cb0
...
@@ -31,7 +31,7 @@ configuration parameter.
...
@@ -31,7 +31,7 @@ configuration parameter.
location /basic_status {
location
=
/basic_status {
stub_status;
stub_status;
}
}
...
...
pod/nginx/ngx_http_upstream_module.pod
View file @
3be52cb0
...
@@ -1111,6 +1111,46 @@ commercial subscription.
...
@@ -1111,6 +1111,46 @@ commercial subscription.
=head2 random
B<syntax:> random I<[C<two> [I<C<method>>]]>
B<context:> I<upstream>
This directive appeared in version 1.15.1.
Specifies that a group should use a load balancing method where a request
is passed to a randomly selected server, taking into account weights
of servers.
The optional C<two> parameter
instructs nginx to randomly select
L<two|https://homes.cs.washington.edu/~karlin/papers/balls.pdf>
servers and then choose a server
using the specified C<method>.
The default method is C<least_conn>
which passes a request to a server
with the least number of active connections.
=head2 sticky
=head2 sticky
...
...
pod/nginx/ngx_stream_core_module.pod
View file @
3be52cb0
...
@@ -254,9 +254,12 @@ C<reuseport>
...
@@ -254,9 +254,12 @@ C<reuseport>
this parameter (1.9.1) instructs to create an individual listening socket
this parameter (1.9.1) instructs to create an individual listening socket
for each worker process
for each worker process
(using the C<SO_REUSEPORT> socket option), allowing a kernel
(using the
C<SO_REUSEPORT> socket option on Linux 3.9+ and DragonFly BSD,
or C<SO_REUSEPORT_LB> on FreeBSD 12+), allowing a kernel
to distribute incoming connections between worker processes.
to distribute incoming connections between worker processes.
This currently works only on Linux 3.9+ and DragonFly BSD.
This currently works only on Linux 3.9+, DragonFly BSD,
and FreeBSD 12+ (1.15.1).
B<NOTE>
B<NOTE>
...
...
pod/nginx/ngx_stream_js_module.pod
View file @
3be52cb0
...
@@ -19,29 +19,9 @@ a subset of the JavaScript language.
...
@@ -19,29 +19,9 @@ a subset of the JavaScript language.
This module is not built by default, it should be compiled with
This module is not built by default.
the njs module using the
Download and install instructions are available
C<--add-module> configuration parameter:
L<here|njs_about>.
./configure --add-module=<value>path-to-njs</value>/nginx
The L<repository|http://hg.nginx.org/njs>
with the njs module can be cloned with the following command
(requires L<Mercurial|https://www.mercurial-scm.org> client):
hg clone http://hg.nginx.org/njs
This module can also be built as
L<dynamic|ngx_core_module>:
./configure --add-dynamic-module=<value>path-to-njs</value>/nginx
...
@@ -52,6 +32,9 @@ L<dynamic|ngx_core_module>:
...
@@ -52,6 +32,9 @@ L<dynamic|ngx_core_module>:
load_module modules/ngx_stream_js_module.so;
...
stream {
stream {
js_include stream.js;
js_include stream.js;
...
...
pod/nginx/ngx_stream_ssl_preread_module.pod
View file @
3be52cb0
...
@@ -81,6 +81,28 @@ Selecting an upstream based on protocol:
...
@@ -81,6 +81,28 @@ Selecting an upstream based on protocol:
Selecting an upstream based on SSL protocol version:
map $ssl_preread_protocol $upstream {
"" ssh.example.com:22;
"TLSv1.2" new.example.com:443;
default tls.example.com:443;
}
# ssh and https on the same port
server {
listen 192.168.0.1:443;
proxy_pass $upstream;
ssl_preread on;
}
=head1 Directives
=head1 Directives
=head2 ssl_preread
=head2 ssl_preread
...
@@ -119,6 +141,15 @@ the L<preread|stream_processing> phase.
...
@@ -119,6 +141,15 @@ the L<preread|stream_processing> phase.
=item C<$ssl_preread_protocol>
the highest SSL protocol version supported by the client (1.15.2)
=item C<$ssl_preread_server_name>
=item C<$ssl_preread_server_name>
...
...
pod/nginx/ngx_stream_upstream_module.pod
View file @
3be52cb0
...
@@ -651,11 +651,15 @@ weighted round-robin balancing method.
...
@@ -651,11 +651,15 @@ weighted round-robin balancing method.
If the C<connect> parameter is specified,
If the C<connect> parameter is specified,
time to connect to the upstream server is used.
time to
connect
to the upstream server is used.
If the C<first_byte> parameter is specified,
If the C<first_byte> parameter is specified,
time to receive the first byte of data is used.
time to receive the
first byte of data is used.
If the C<last_byte> is specified,
If the C<last_byte> is specified,
time to receive the last byte of data is used.
time to receive the
last byte of data is used.
If the C<inflight> parameter is specified (1.11.6),
If the C<inflight> parameter is specified (1.11.6),
incomplete connections are also taken into account.
incomplete connections are also taken into account.
...
@@ -682,6 +686,46 @@ commercial subscription.
...
@@ -682,6 +686,46 @@ commercial subscription.
=head2 random
B<syntax:> random I<[C<two> [I<C<method>>]]>
B<context:> I<upstream>
This directive appeared in version 1.15.1.
Specifies that a group should use a load balancing method where a connection
is passed to a randomly selected server, taking into account weights
of servers.
The optional C<two> parameter
instructs nginx to randomly select
L<two|https://homes.cs.washington.edu/~karlin/papers/balls.pdf>
servers and then choose a server
using the specified C<method>.
The default method is C<least_conn>
which passes a connection to a server
with the least number of active connections.
=head1 Embedded Variables
=head1 Embedded Variables
...
...
pod/nginx/njs_api.pod
View file @
3be52cb0
...
@@ -20,6 +20,567 @@ for extending nginx functionality.
...
@@ -20,6 +20,567 @@ for extending nginx functionality.
=head1 Core
=head1 Core
=head2 String
There are two types of strings:
a C<Unicode string> (default) and
a C<byte string>.
A C<Unicode string> corresponds to an ECMAScript string
which contains Unicode characters.
C<Byte strings> contain a sequence of bytes.
They are used to serialize Unicode strings
to external data and deserialize from external sources.
For example, the toUTF8() method serializes
a Unicode string to a byte string using UTF8 encoding:
>> '£'.toUTF8().toString('hex')
c2a3 /* C2 A3 is the UTF8 representation of 00A3 ('£') code point */
The toBytes() method serializes
a Unicode string with code points up to 255 into a byte string,
otherwise, C<null> is returned:
>> '£'.toBytes().toString('hex')
a3 /* a3 is a byte equal to 00A3 ('£') code point */
Only byte strings can be converted to different encodings.
For example, a string cannot be encoded to C<hex> directly:
>> 'αβγδ'.toString('base64')
TypeError: argument must be a byte string
at String.prototype.toString (native)
at main (native)
To convert a Unicode string to hex,
first, it should be converted to a byte string and then to hex:
>> 'αβγδ'.toUTF8().toString('base64')
zrHOss6zzrQ=
=over
=item C<String.fromCodePoint(I<C<codePoint1>>[, ...[,
I<C<codePoint2>>]])>
Returns a string from one or more Unicode code points.
>> String.fromCodePoint(97, 98, 99, 100)
abcd
=item C<String.prototype.concat(I<C<string1>>[, ...,
I<C<stringN>>])>
Returns a string that contains the concatenation of specified
C<strings>.
>> "a".concat("b", "c")
abc
=item C<String.prototype.endsWith(I<C<searchString>>[,
I<C<length>>])>
Returns C<true> if a string ends with the characters
of a specified string, otherwise C<false>.
The optional C<length> parameter is the the length of string.
If omitted, the default value is the length of the string.
>> 'abc'.endsWith('abc')
true
>> 'abca'.endsWith('abc')
false
=item C<String.prototype.fromBytes(I<C<start>>[,
I<C<end>>])>
(njs specific) Returns a new Unicode string from a byte string
where each byte is replaced with a corresponding Unicode code point.
=item C<String.prototype.fromUTF8(I<C<start>>[,
I<C<end>>])>
(njs specific) Converts a byte string containing a valid UTF8 string
into a Unicode string,
otherwise C<null> is returned.
=item C<String.prototype.includes(I<C<searchString>>[,
I<C<position>>]))>
Returns C<true> if a string is found within another string,
otherwise C<false>.
The optional C<position> parameter is the position
within the string at which to begin search for C<searchString>.
Default value is 0.
>> 'abc'.includes('bc')
true
=item C<String.prototype.indexOf(I<C<searchString>>[,
I<C<fromIndex>>])>
Returns the position of the first occurrence
of the C<searchString>
The search is started at C<fromIndex>.
Returns I<C<-1>> if the value is not found.
The C<fromIndex> is an integer,
default value is 0.
If C<fromIndex> is lower than 0
or greater than
String.prototype.lengthI<C<>>,
the search starts at index I<C<0>> and
I<C<String.prototype.length>>.
>> 'abcdef'.indexOf('de', 2)
3
=item C<String.prototype.lastIndexOf(I<C<searchString>>[,
I<C<fromIndex>>])>
Returns the position of the last occurrence
of the C<searchString>,
searching backwards from C<fromIndex>.
Returns I<C<-1>> if the value is not found.
If C<searchString> is empty,
then C<fromIndex> is returned.
>> "nginx".lastIndexOf("gi")
1
=item C<String.prototype.length>
Returns the length of the string.
>> 'αβγδ'.length
4
=item C<String.prototype.match([I<C<regexp>>])>
Matches a string against a C<regexp>.
>> 'nginx'.match( /ng/i )
ng
=item C<String.prototype.repeat(I<C<number>>)>
Returns a string
with the specified C<number> of copies of the string.
>> 'abc'.repeat(3)
abcabcabc
=item C<String.prototype.replace([I<C<regexp>>E<verbar>I<C<string>>[,
I<C<string>>E<verbar>I<C<function>>]])>
Returns a new string with matches of a pattern
(C<string> or a C<regexp>)
replaced by a C<string> or a C<function>.
>> 'abcdefgh'.replace('d', 1)
abc1efgh
=item C<String.prototype.search([I<C<regexp>>])>
Searches for a string using a C<regexp>
>> 'abcdefgh'.search('def')
3
=item C<String.prototype.slice(I<C<start>>[,
I<C<end>>])>
Returns a new string containing a part of an
original string between C<start>
and C<end> or
from C<start> to the end of the string.
>> 'abcdefghijklmno'.slice(NaN, 5)
abcde
=item C<String.prototype.startsWith(I<C<searchString>>[,
I<C<position>>])>
Returns C<true> if a string begins with the characters
of a specified string, otherwise C<false>.
The optional C<position> parameter is the position
in this string at which to begin search for C<searchString>.
Default value is 0.
>> 'abc'.startsWith('abc')
true
> 'aabc'.startsWith('abc')
false
=item C<String.prototype.substr(I<C<start>>[,
I<C<length>>])>
Returns the part of the string of the specified C<length>
from C<start>
or from C<start> to the end of the string.
>> 'abcdefghijklmno'.substr(3, 5)
defgh
=item C<String.prototype.substring(I<C<start>>[,
I<C<end>>])>
Returns the part of the string between
C<start> and C<end> or
from C<start> to the end of the string.
>> 'abcdefghijklmno'.substring(3, 5)
de
=item C<String.prototype.toBytes(start[,
end])>
(njs specific) Serializes a Unicode string to a byte string.
Returns C<null> if a character larger than 255 is
found in the string.
=item C<String.prototype.toLowerCase()>
Converts a string to lower case.
The method supports only simple Unicode folding.
>> 'ΑΒΓΔ'.toLowerCase()
αβγδ
=item C<String.prototype.toString([I<C<encoding>>])>
If no C<encoding> is specified,
returns a specified Unicode string or byte string as in ECMAScript.
(njs specific) If C<encoding> is specified,
encodes a byte string to
C<hex>,
C<base64>, or
C<base64url>.
>> 'αβγδ'.toUTF8().toString('base64url')
zrHOss6zzrQ
=item C<String.prototype.toUpperCase()>
Converts a string to upper case.
The method supports only simple Unicode folding.
>> 'αβγδ'.toUpperCase()
ΑΒΓΔ
=item C<String.prototype.toUTF8(I<C<start>>[,
I<C<end>>])>
(njs specific) Serializes a Unicode string
to a byte string using UTF8 encoding.
>> 'αβγδ'.toUTF8().length
8
>> 'αβγδ'.length
4
=item C<String.prototype.trim()>
Removes whitespaces from both ends of a string.
>> ' abc '.trim()
abc
=item C<String.prototype.split(([I<C<string>>E<verbar>I<C<regexp>>[,
I<C<limit>>]]))>
Returns match of a string against a C<regexp>.
The optional C<limit> parameter is an integer that specifies
a limit on the number of splits to be found.
>> 'abc'.split('')
a,b,c
=item C<encodeURI(I<C<URI>>)>
encodes a URI by replacing each instance of certain characters by
one, two, three, or four escape sequences
representing the UTF-8 encoding of the character
>> encodeURI('012αβγδ')
012%CE%B1%CE%B2%CE%B3%CE%B4
=item C<encodeURIComponent(I<C<encodedURIString>>)>
Encodes a URI by replacing each instance of certain characters
by one, two, three, or four escape sequences
representing the UTF-8 encoding of the character.
>> encodeURIComponent('[@?=')
%5B%40%3F%3D
=item C<decodeURI(I<C<encodedURI>>)>
Decodes a previously encoded URI.
>> decodeURI('012%CE%B1%CE%B2%CE%B3%CE%B4')
012αβγδ
=item C<decodeURIComponent(I<C<decodedURIString>>)>
Decodes an encoded component of a previously encoded URI.
>> decodeURIComponent('%5B%40%3F%3D')
[@?=
=back
=head2 JSON
=head2 JSON
...
@@ -274,180 +835,220 @@ If encoding is not provided, a byte string is returned.
...
@@ -274,180 +835,220 @@ If encoding is not provided, a byte string is returned.
=head
1 HTTP
=head
2 Timers
The C<HTTP> objects are available only in the
L<ngx_http_js_module|ngx_http_js_module> module.
=over
=
head2 Request
=
item C<clearTimeout(I<C<timeout>>)>
=over
Cancels a C<timeout> object
created by setTimeout().
=item C<req.uri>
=item C<setTimeout(I<C<function>>,
I<C<ms>>[, I<C<arg1>>, I<C<argN>>])>
current URI in a request, read-only
Calls a C<function>
after a specified number of C<milliseconds>.
One or more optional C<arguments>
can be passed to the specified function.
Returns a C<timeout> object.
function handler(v)
{
// ...
}
=item C<req.method>
t = setTimeout(handler, 12);
// ...
clearTimeout(t);
request method, read-only
=item C<req.httpVersion>
=back
HTTP version, read-only
=
item C<req.remoteAddress>
=
head2 File System
The File System module provides operations with files.
The module object is returned by C<require('fs')>.
client address, read-only
=over
=item C<req.headers{}>
=item C<appendFileSync(I<C<filename>>,
I<C<data>>[, I<C<options>>])>
request headers object, read-only.
Synchronously appends specified C<data>
to a file with provided C<filename>.
If the file does not exist, it will be created.
The C<options> parameter is expected to be
an object with the following keys:
=over
For example, the C<Header-Name> header
can be accessed with the syntax C<headers['Header-Name']>
or C<headers.Header_name>
=item C<mode>
=item C<req.args{}>
mode option, by default is C<0o666>
request arguments object, read-only
=item C<flag>
=item C<request.variables{}>
file system flag,
by default is C<a>
nginx variables object, read-only
=back
=item C<req.response>
=item C<readFileSync(I<C<filename>>[,
I<C<options>>])>
the response object (0.2.0), read-only
=item C<req.log(I<C<string>>)>
Synchronously returns the contents of the file
with provided C<filename>.
The C<options> parameter holds
C<string> that specifies encoding.
If not specified, a byte string is returned.
If C<utf8> encoding is specified, a Unicode string is returned.
Otherwise, C<options> is expected to be
an object with the following keys:
=over
writes a C<string> to the error log
=item C<encoding>
on the C<info> level of logging
=item C<req.warn(I<C<string>>)>
encoding, by default is not specified.
The encoding can be C<utf8>
writes a C<string> to the error log
=item C<flag>
on the C<warning> level of logging (0.2.0)
=item C<req.error(I<C<string>>)>
file system flag,
by default is C<r>
writes a C<string> to the error log
on the C<error> level of logging (0.2.0)
=back
=item C<req.subrequest(I<C<uri>>[,
I<C<options>>[, I<C<callback>>]])>
>> var fs = require('fs')
undefined
>> var file = fs.readFileSync('/file/path.tar.gz')
undefined
>> var gzipped = /^\x1f\x8b/.test(file); gzipped
true
creates a subrequest with the given C<uri> and
C<options>, and installs
an optional completion C<callback> (0.2.0).
If C<options> is a string, then it
=item C<writeFileSync(I<C<filename>>,
holds the subrequest arguments string.
I<C<data>>[,
Otherwise, C<options> is expected to be
I<C<options>>])>
an object with the following keys:
Synchronously writes C<data> to a file
with provided C<filename>.
If the file does not exist, it will be created,
if the file exists, it will be replaced.
The C<options> parameter is expected to be
an object with the following keys:
=over
=over
=item C<
args
>
=item C<
mode
>
arguments string
mode option, by default is C<0o666>
=item C<
body
>
=item C<
flag
>
request body
file system flag,
by default is C<w>
=item C<method>
=back
HTTP method
>> var fs = require('fs')
undefined
>> var file = fs.writeFileSync('hello.txt', 'Hello world')
undefined
...
@@ -459,11 +1060,110 @@ HTTP method
...
@@ -459,11 +1060,110 @@ HTTP method
The completion C<callback>
=head3 File System Flags
receives a reply object.
The C<flag> option can accept the following values:
=over
=item *
C<a>E<mdash>open a file for appending.
The file is created if it does not exist
=item *
C<ax>E<mdash>the same as C<a>
but fails if the file already exists
=item *
C<a+>E<mdash>open a file for reading and appending.
If the file does not exist, it will be created
=item *
C<ax+>E<mdash>the same as C<a+>
but fails if the file already exists
=item *
C<as>E<mdash>open a file for appending in synchronous mode.
If the file does not exist, it will be created
=item *
C<as+>E<mdash>open a file for reading and appending
in synchronous mode.
If the file does not exist, it will be created
=item *
C<r>E<mdash>open a file for reading.
An exception occurs if the file does not exist
=item *
C<r+>E<mdash>open a file for reading and writing.
An exception occurs if the file does not exist
=item *
C<rs+>E<mdash>open a file for reading and writing
in synchronous mode.
Instructs the operating system to bypass the local file system cache
=item *
C<w>E<mdash>open a file for writing.
If the file does not exist, it will be created.
If the file exists, it will be replaced
=item *
C<wx>E<mdash>the same as C<w>
but fails if the file already exists
=item *
C<w+>E<mdash>open a file for reading and writing.
If the file does not exist, it will be created.
If the file exists, it will be replaced
=item *
C<wx+>E<mdash>the same as C<w+>
but fails if the file already exists
...
@@ -474,199 +1174,273 @@ receives a reply object.
...
@@ -474,199 +1174,273 @@ receives a reply object.
=head2 Response
=head1 HTTP Request
The HTTP request object is available only in the
L<ngx_http_js_module|ngx_http_js_module> module.
All string properties of the object are byte strings.
=over
=over
=item C<res.status>
=item C<r.args{}>
request arguments object, read-only
response status, writable
=item C<r.error(I<C<string>>)>
=item C<res.headers{}>
writes a C<string> to the error log
on the C<error> level of logging
response headers object
=item C<r.finish()>
=item C<res.contentType>
finishes sending a response to the client
the response C<Content-Type> header field value, writable
=item C<r.headersIn{}>
=item C<res.contentLength>
incoming headers object, read-only.
the response C<Content-Length> header field value, writable
For example, the C<Foo> header
can be accessed with the syntax C<headersIn.foo>
or C<headersIn['Foo']>
=item C<res.sendHeader()>
=item C<r.headersOut{}>
sends the HTTP header to the client
=item C<res.send(I<C<string>>)>
outgoing headers object, writable.
For example, the C<Foo> header
can be accessed with the syntax C<headersOut.foo>
or C<headersOut['Foo']>
sends a part of the response body to the client
=item C<r
es.finish()
>
=item C<r
.httpVersion
>
finishes sending a response to the client
HTTP version, read-only
=item C<r.log(I<C<string>>)>
=item C<res.return(status[, string])>
writes a C<string> to the error log
on the C<info> level of logging
sends
the entire response with the specified C<status> to the client
(0.2.0)
=item C<r.internalRedirect(I<C<uri>>)>
It is possible to specify either a redirect URL
(for codes 301, 302, 303, 307, and 308)
or the response body text (for other codes) as the second argument
performs an internal redirect to the specified C<uri>.
If the uri starts with the “C<@>” prefix,
it is considered a named location.
=
back
=
item C<r.method>
HTTP method, read-only
=head2 Reply
=item C<r.parent>
=over
references the parent request object
=item C<r.remoteAddress>
=item C<reply.uri>
client address, read-only
current URI in a reply, read-only
=item C<r.requestBody>
=item C<reply.method>
holds the request body, read-only
reply method, read-only
=item C<r.responseBody>
=item C<reply.status>
holds the subrequest response body, read-only.
The size of C<r.responseBody> is limited by the
L<ngx_http_core_module>
directive.
reply status, writable
=item C<r.return(status[, string])>
=item C<reply.contentType>
sends the entire response
with the specified C<status> to the client
the response C<Content-Type> header field value, writable
It is possible to specify either a redirect URL
(for codes 301, 302, 303, 307, and 308)
or the response body text (for other codes) as the second argument
=item C<reply.contentLength>
=item C<r.send(I<C<string>>)>
the response C<Content-Length> header field value, writable
=item C<reply.headers{}>
sends a part of the response body to the client
=item C<r.sendHeader()>
reply headers object, read-only
sends the HTTP headers to the client
=item C<r.status>
status, writable
=item C<r.variables{}>
nginx variables object, read-only
=item C<r.warn(I<C<string>>)>
writes a C<string> to the error log
on the C<warning> level of logging
=back
=item C<r.uri>
current URI, read-only
Additionally, the C<reply> object has
the following properties:
=item C<r.subrequest(I<C<uri>>[,
I<C<options>>[, I<C<callback>>]])>
creates a subrequest with the given C<uri> and
C<options>, and installs
an optional completion C<callback>.
If C<options> is a string, then it
holds the subrequest arguments string.
Otherwise, C<options> is expected to be
an object with the following keys:
=over
=over
=item C<args>
arguments string
=item C<reply.body>
=item C<body>
holds the subrequest response body
request body
=item C<reply.parent>
=item C<method>
references the parent request object
HTTP method
...
@@ -678,21 +1452,31 @@ references the parent request object
...
@@ -678,21 +1452,31 @@ references the parent request object
=head1 Stream
The completion C<callback> receives
a subrequest response object with methods and properties
identical to the parent request object.
The C<stream> objects are available only in the
L<ngx_stream_js_module|ngx_stream_js_module>
=back
module.
=head1 Stream Session
=head2 Session
The stream session object is available only in the
L<ngx_stream_js_module|ngx_stream_js_module>
module.
All string properties of the object are byte strings.
=over
=over
...
@@ -806,7 +1590,7 @@ on the C<info> level of logging
...
@@ -806,7 +1590,7 @@ on the C<info> level of logging
writes a sent C<string> to the error log
writes a sent C<string> to the error log
on the C<warning> level of logging
(0.2.0)
on the C<warning> level of logging
...
@@ -816,7 +1600,7 @@ on the C<warning> level of logging (0.2.0)
...
@@ -816,7 +1600,7 @@ on the C<warning> level of logging (0.2.0)
writes a sent C<string> to the error log
writes a sent C<string> to the error log
on the C<error> level of logging
(0.2.0)
on the C<error> level of logging
...
@@ -850,8 +1634,8 @@ on the C<error> level of logging (0.2.0)
...
@@ -850,8 +1634,8 @@ on the C<error> level of logging (0.2.0)
The F<urldecode.js> file:
The F<urldecode.js> file:
function decoded_foo(r
eq, res
) {
function decoded_foo(r) {
return decodeURIComponent(r
eq
.args.foo);
return decodeURIComponent(r.args.foo);
}
}
...
@@ -883,7 +1667,7 @@ The F<urldecode.js> file:
...
@@ -883,7 +1667,7 @@ The F<urldecode.js> file:
The F<urlencode.js> file:
The F<urlencode.js> file:
function encoded_foo(r
eq, res
) {
function encoded_foo(r) {
return encodeURIComponent('foo & bar?');
return encodeURIComponent('foo & bar?');
}
}
...
@@ -892,6 +1676,40 @@ The F<urlencode.js> file:
...
@@ -892,6 +1676,40 @@ The F<urlencode.js> file:
=head2 Internal Redirect
js_include redirect.js;
location /redirect {
js_content redirect;
}
location @named {
return 200 named;
}
The F<redirect.js> file:
function redirect(r) {
r.internalRedirect('@named');
}
=head2 Returning Fastest Response from Proxy
=head2 Returning Fastest Response from Proxy
...
@@ -921,17 +1739,17 @@ The F<urlencode.js> file:
...
@@ -921,17 +1739,17 @@ The F<urlencode.js> file:
The F<fastresponse.js> file:
The F<fastresponse.js> file:
function content(r
eq, res
) {
function content(r) {
var n = 0;
var n = 0;
function done(re
ply
) {
function done(re
s
) {
if (n++ == 0) {
if (n++ == 0) {
r
es.return(reply.status, reply.b
ody);
r
.return(res.status, res.responseB
ody);
}
}
}
}
r
eq.subrequest('/foo', req
.variables.args, done);
r
.subrequest('/foo', r
.variables.args, done);
r
eq.subrequest('/bar', req
.variables.args, done);
r
.subrequest('/bar', r
.variables.args, done);
}
}
...
@@ -969,7 +1787,7 @@ The F<hs_jwt.js> file:
...
@@ -969,7 +1787,7 @@ The F<hs_jwt.js> file:
return s + '.' + h.update(s).digest().toString('base64url');
return s + '.' + h.update(s).digest().toString('base64url');
}
}
function jwt(r
eq, res
) {
function jwt(r) {
var claims = {
var claims = {
"iss" : "nginx",
"iss" : "nginx",
"sub" : "alice",
"sub" : "alice",
...
@@ -1018,28 +1836,29 @@ The F<hs_jwt.js> file:
...
@@ -1018,28 +1836,29 @@ The F<hs_jwt.js> file:
The F<subrequest.js> file:
The F<subrequest.js> file:
function set_keyval(r
eq, res
) {
function set_keyval(r) {
r
eq
.subrequest('/api/3/http/keyvals/foo',
r.subrequest('/api/3/http/keyvals/foo',
{ method: 'POST',
{ method: 'POST',
body: JSON.stringify({ foo: 789, bar: "ss dd 00" })},
body: JSON.stringify({ foo: 789, bar: "ss dd 00" })},
function(re
ply
) {
function(re
s
) {
if (re
ply
.status >= 300) {
if (re
s
.status >= 300) {
r
es.return(reply.status, reply.b
ody);
r
.return(res.status, res.responseB
ody);
return;
return;
}
}
r
es
.return(500);
r.return(500);
});
});
}
}
function version(req, res) {
req.subrequest('/api/3/nginx', { method: 'GET' }, function(reply) {
function version(r) {
if (reply.status != 200) {
r.subrequest('/api/3/nginx', { method: 'GET' }, function(res) {
res.return(reply.status);
if (res.status != 200) {
r.return(res.status);
return;
return;
}
}
var json = JSON.parse(re
ply.b
ody);
var json = JSON.parse(re
s.responseB
ody);
r
es
.return(200, json.version);
r.return(200, json.version);
});
});
}
}
...
@@ -1079,9 +1898,9 @@ The F<subrequest.js> file:
...
@@ -1079,9 +1898,9 @@ The F<subrequest.js> file:
The F<hash.js> file:
The F<hash.js> file:
function create_secure_link(r
eq, res
) {
function create_secure_link(r) {
return require('crypto').createHash('md5')
return require('crypto').createHash('md5')
.update(r
eq
.uri).update(" mykey")
.update(r.uri).update(" mykey")
.digest('base64url');
.digest('base64url');
}
}
...
...
pod/nginx/njs_changes.pod
View file @
3be52cb0
...
@@ -7,6 +7,236 @@
...
@@ -7,6 +7,236 @@
njs_changes - njs Changes
njs_changes - njs Changes
=head1 Changes with 0.2.2
Release Date:
19 June 2018
nginx modules:
=over
=item *
Change:
merged HTTP C<Response> and C<Reply>
into L<HTTP Request|njs_api>.
New members of C<Request>:
=over
=item *
C<req.status> (C<res.status>)
=item *
C<req.parent> (C<reply.parent>)
=item *
C<req.requestBody> (C<req.body>)
=item *
C<req.responseBody> (C<reply.body>)
=item *
C<req.headersIn> (C<req.headers>)
=item *
C<req.headersOut> (C<res.headers>)
=item *
C<req.sendHeader()> (C<res.sendHeader()>)
=item *
C<req.send()> (C<res.send()>)
=item *
C<req.finish()> (C<res.finish()>)
=item *
C<req.return()> (C<res.return()>)
=back
Deprecated members of C<Request>:
=over
=item *
C<req.body> (use C<req.requestBody>
or C<req.responseBody>)
=item *
C<req.headers> (use C<req.headersIn>
or C<req.headersOut>)
=item *
C<req.response>
=back
The deprecated properties will be removed in next releases.
=item *
Feature:
HTTP L<internalRedirect()|njs_api>
method.
=back
Core:
=over
=item *
Bugfix:
fixed heap-buffer-overflow in C<crypto.createHmac()>.
=back
=head1 Changes with 0.2.1
=head1 Changes with 0.2.1
...
...
resty.index
View file @
3be52cb0
...
@@ -38,9 +38,9 @@ module contributing_changes
...
@@ -38,9 +38,9 @@ module contributing_changes
module control
module control
section 18 899 name
section 18 899 name
section 899 31
11
changing configuration
section 899 31
07
changing configuration
section 31
11 3735
rotating log-files
section 31
07 3731
rotating log-files
section 373
5 7797
upgrading executable on the fly
section 373
1 7796
upgrading executable on the fly
module converting_rewrite_rules
module converting_rewrite_rules
section 18 86 name
section 18 86 name
...
@@ -135,7 +135,7 @@ module events
...
@@ -135,7 +135,7 @@ module events
section 18 1854 name
section 18 1854 name
module example
module example
section 18 436
7
name
section 18 436
9
name
module faq
module faq
section 18 325 name
section 18 325 name
...
@@ -323,7 +323,7 @@ module ngx_http_charset_module
...
@@ -323,7 +323,7 @@ module ngx_http_charset_module
module ngx_http_core_module
module ngx_http_core_module
aliases ngx_core
aliases ngx_core
section 17 85 name
section 17 85 name
section 85 63
672
directives
section 85 63
773
directives
section 104 472 absolute_redirect
section 104 472 absolute_redirect
section 472 2923 aio
section 472 2923 aio
section 2923 3347 aio_write
section 2923 3347 aio_write
...
@@ -354,111 +354,111 @@ module ngx_http_core_module
...
@@ -354,111 +354,111 @@ module ngx_http_core_module
section 16008 16043 exact
section 16008 16043 exact
section 16043 16198 before
section 16043 16198 before
section 16198 16794 ignore_invalid_headers
section 16198 16794 ignore_invalid_headers
section 16794 1810
3
internal
section 16794 1810
5
internal
section 1810
3 18934
keepalive_disable
section 1810
5 18936
keepalive_disable
section 1893
4 19321
keepalive_requests
section 1893
6 19323
keepalive_requests
section 1932
1 19996
keepalive_timeout
section 1932
3 19998
keepalive_timeout
section 1999
6 20752
large_client_header_buffers
section 1999
8 20754
large_client_header_buffers
section 2075
2 21592
limit_except
section 2075
4 21594
limit_except
section 2159
2 22608
limit_rate
section 2159
4 22610
limit_rate
section 226
08 23088
limit_rate_after
section 226
10 23090
limit_rate_after
section 230
88 23954
lingering_close
section 230
90 23956
lingering_close
section 2395
4 24368
lingering_time
section 2395
6 24370
lingering_time
section 243
68 24932
lingering_timeout
section 243
70 24934
lingering_timeout
section 2493
2 33675
listen
section 2493
4 33776
listen
section 33
675 37841
location
section 33
776 37942
location
section 37
841 38104
log_not_found
section 37
942 38205
log_not_found
section 38
104 38357
log_subrequest
section 38
205 38458
log_subrequest
section 38
357 38809
max_ranges
section 38
458 38910
max_ranges
section 38
809 39861
merge_slashes
section 38
910 39962
merge_slashes
section 39
861 40176
msie_padding
section 39
962 40277
msie_padding
section 40
176 40430
msie_refresh
section 40
277 40531
msie_refresh
section 40
430 41687
open_file_cache
section 40
531 41788
open_file_cache
section 41
687 41955
open_file_cache_errors
section 41
788 42056
open_file_cache_errors
section 4
1955 42347
open_file_cache_min_uses
section 4
2056 42448
open_file_cache_min_uses
section 42
347 42604
open_file_cache_valid
section 42
448 42705
open_file_cache_valid
section 42
604 42945
output_buffers
section 42
705 43046
output_buffers
section 4
2945 43321
port_in_redirect
section 4
3046 43422
port_in_redirect
section 43
321 43669
postpone_output
section 43
422 43770
postpone_output
section 43
669 44237
read_ahead
section 43
770 44338
read_ahead
section 44
237 44553
recursive_error_pages
section 44
338 44654
recursive_error_pages
section 44
553 44842
request_pool_size
section 44
654 44943
request_pool_size
section 44
842 45523
reset_timedout_connection
section 44
943 45624
reset_timedout_connection
section 45
523 46939
resolver
section 45
624 47040
resolver
section 4
6939 47194
resolver_timeout
section 4
7040 47295
resolver_timeout
section 47
194 47905
root
section 47
295 48006
root
section 4
7905 48596
satisfy
section 4
8006 48697
satisfy
section 48
596 49082
send_lowat
section 48
697 49183
send_lowat
section 49
082 49502
send_timeout
section 49
183 49603
send_timeout
section 49
502 50516
sendfile
section 49
603 50617
sendfile
section 50
516 50880
sendfile_max_chunk
section 50
617 50981
sendfile_max_chunk
section 50
880 51392
server
section 50
981 51493
server
section 51
392 54126
server_name
section 51
493 54227
server_name
section 54
126 54730
server_name_in_redirect
section 54
227 54831
server_name_in_redirect
section 54
730 55110
server_names_hash_bucket_size
section 54
831 55211
server_names_hash_bucket_size
section 55
110 55397
server_names_hash_max_size
section 55
211 55498
server_names_hash_max_size
section 55
397 56129
server_tokens
section 55
498 56230
server_tokens
section 56
129 56778
subrequest_output_buffer_size
section 56
230 56879
subrequest_output_buffer_size
section 56
778 57207
tcp_nodelay
section 56
879 57308
tcp_nodelay
section 57
207 57758
tcp_nopush
section 57
308 57859
tcp_nopush
section 57
758 60807
try_files
section 57
859 60908
try_files
section 60
807 61678
types
section 60
908 61779
types
section 61
678 62101
types_hash_bucket_size
section 61
779 62202
types_hash_bucket_size
section 62
101 62418
types_hash_max_size
section 62
202 62519
types_hash_max_size
section 62
418 63055
underscores_in_headers
section 62
519 63156
underscores_in_headers
section 63
055 63331
variables_hash_bucket_size
section 63
156 63432
variables_hash_bucket_size
section 63
331 63672
variables_hash_max_size
section 63
432 63773
variables_hash_max_size
section 63
672 70336
embedded variables
section 63
773 70437
embedded variables
section 6
3989 64061
$arg_i<name>
section 6
4090 64162
$arg_i<name>
section 64
061 64113
$args
section 64
162 64214
$args
section 64
113 64267
$binary_remote_addr
section 64
214 64368
$binary_remote_addr
section 64
267 64466
$body_bytes_sent
section 64
368 64567
$body_bytes_sent
section 64
466 64542
$bytes_sent
section 64
567 64643
$bytes_sent
section 64
542 64610
$connection
section 64
643 64711
$connection
section 64
610 64715
$connection_requests
section 64
711 64816
$connection_requests
section 64
715 64786
$content_length
section 64
816 64887
$content_length
section 64
786 64853
$content_type
section 64
887 64954
$content_type
section 64
853 64910
$cookie_i<name>
section 64
954 65011
$cookie_i<name>
section 6
4910 65007
$document_root
section 6
5011 65108
$document_root
section 65
007 65053
$document_uri
section 65
108 65154
$document_uri
section 65
053 65227
$host
section 65
154 65328
$host
section 65
227 65263
$hostname
section 65
328 65364
$hostname
section 65
263 65439
$http_i<name>
section 65
364 65540
$http_i<name>
section 65
439 65539
$https
section 65
540 65640
$https
section 65
539 65637
$is_args
section 65
640 65738
$is_args
section 65
637 65738
$limit_rate
section 65
738 65839
$limit_rate
section 65
738 65832
$msec
section 65
839 65933
$msec
section 65
832 65877
$nginx_version
section 65
933 65978
$nginx_version
section 65
877 65924
$pid
section 65
978 66025
$pid
section 6
5924 66020
$pipe
section 6
6025 66121
$pipe
section 66
020 66264
$proxy_protocol_addr
section 66
121 66365
$proxy_protocol_addr
section 66
264 66505
$proxy_protocol_port
section 66
365 66606
$proxy_protocol_port
section 66
505 66552
$query_string
section 66
606 66653
$query_string
section 66
552 66739
$realpath_root
section 66
653 66840
$realpath_root
section 66
739 66783
$remote_addr
section 66
840 66884
$remote_addr
section 66
783 66824
$remote_port
section 66
884 66925
$remote_port
section 66
824 66902
$remote_user
section 66
925 67003
$remote_user
section 6
6902 66954
$request
section 6
7003 67055
$request
section 6
6954 67242
$request_body
section 6
7055 67343
$request_body
section 67
242 67898
$request_body_file
section 67
343 67999
$request_body_file
section 67
898 68003
$request_completion
section 67
999 68104
$request_completion
section 68
003 68139
$request_filename
section 68
104 68240
$request_filename
section 68
139 68249
$request_id
section 68
240 68350
$request_id
section 68
249 68363
$request_length
section 68
350 68464
$request_length
section 68
363 68449
$request_method
section 68
464 68550
$request_method
section 68
449 68622
$request_time
section 68
550 68723
$request_time
section 68
622 68694
$request_uri
section 68
723 68795
$request_uri
section 68
694 68766
$scheme
section 68
795 68867
$scheme
section 68
766 68948
$sent_http_i<name>
section 68
867 69049
$sent_http_i<name>
section 6
8948 69158
$sent_trailer_i<name>
section 6
9049 69259
$sent_trailer_i<name>
section 69
158 69414
$server_addr
section 69
259 69515
$server_addr
section 69
414 69487
$server_name
section 69
515 69588
$server_name
section 69
487 69560
$server_port
section 69
588 69661
$server_port
section 69
560 69712
$server_protocol
section 69
661 69813
$server_protocol
section 69
712 69972
$status
section 69
813 70073
$status
section
69972 70061
$time_iso8601
section
70073 70162
$time_iso8601
section 70
061 70141
$time_local
section 70
162 70242
$time_local
section 70
141 70336
$uri
section 70
242 70437
$uri
module ngx_http_dav_module
module ngx_http_dav_module
aliases ngx_dav
aliases ngx_dav
...
@@ -489,7 +489,7 @@ module ngx_http_fastcgi_module
...
@@ -489,7 +489,7 @@ module ngx_http_fastcgi_module
aliases ngx_fastcgi
aliases ngx_fastcgi
section 17 188 name
section 17 188 name
section 188 628 example configuration
section 188 628 example configuration
section 628 3957
4
directives
section 628 3957
5
directives
section 647 1912 fastcgi_bind
section 647 1912 fastcgi_bind
section 1912 2409 fastcgi_buffer_size
section 1912 2409 fastcgi_buffer_size
section 2409 3673 fastcgi_buffering
section 2409 3673 fastcgi_buffering
...
@@ -510,49 +510,49 @@ module ngx_http_fastcgi_module
...
@@ -510,49 +510,49 @@ module ngx_http_fastcgi_module
section 15592 15975 fastcgi_cache_revalidate
section 15592 15975 fastcgi_cache_revalidate
section 15975 17766 fastcgi_cache_use_stale
section 15975 17766 fastcgi_cache_use_stale
section 17766 19656 fastcgi_cache_valid
section 17766 19656 fastcgi_cache_valid
section 19656 2027
4
fastcgi_catch_stderr
section 19656 2027
5
fastcgi_catch_stderr
section 2027
4 20603
fastcgi_connect_timeout
section 2027
5 20604
fastcgi_connect_timeout
section 2060
3 20992
fastcgi_force_ranges
section 2060
4 20993
fastcgi_force_ranges
section 2099
2 21484
fastcgi_hide_header
section 2099
3 21485
fastcgi_hide_header
section 2148
4 21832
fastcgi_ignore_client_abort
section 2148
5 21833
fastcgi_ignore_client_abort
section 2183
2 22951
fastcgi_ignore_headers
section 2183
3 22952
fastcgi_ignore_headers
section 2295
1 23655
fastcgi_index
section 2295
2 23656
fastcgi_index
section 2365
5 24070
fastcgi_intercept_errors
section 2365
6 24071
fastcgi_intercept_errors
section 2407
0 24618
fastcgi_keep_conn
section 2407
1 24619
fastcgi_keep_conn
section 2461
8 25251
fastcgi_limit_rate
section 2461
9 25252
fastcgi_limit_rate
section 2525
1 26044
fastcgi_max_temp_file_size
section 2525
2 26045
fastcgi_max_temp_file_size
section 2604
4 28542
fastcgi_next_upstream
section 2604
5 28543
fastcgi_next_upstream
section 2656
3 26707
error
section 2656
4 26708
error
section 2670
7 26858
timeout
section 2670
8 26859
timeout
section 2685
8 26935
invalid_header
section 2685
9 26936
invalid_header
section 2693
5 27006
http_500
section 2693
6 27007
http_500
section 2700
6 27077
http_503
section 2700
7 27078
http_503
section 2707
7 27148
http_403
section 2707
8 27149
http_403
section 2714
8 27219
http_404
section 2714
9 27220
http_404
section 272
19 27300
http_429
section 272
20 27301
http_429
section 2730
0 27616
non_idempotent
section 2730
1 27617
non_idempotent
section 2761
6 28542
off
section 2761
7 28543
off
section 2854
2 28899
fastcgi_next_upstream_timeout
section 2854
3 28900
fastcgi_next_upstream_timeout
section 28
899 29259
fastcgi_next_upstream_tries
section 28
900 29260
fastcgi_next_upstream_tries
section 292
59 29809
fastcgi_no_cache
section 292
60 29810
fastcgi_no_cache
section 298
09 31322
fastcgi_param
section 298
10 31323
fastcgi_param
section 3132
2 32137
fastcgi_pass
section 3132
3 32138
fastcgi_pass
section 3213
7 32381
fastcgi_pass_header
section 3213
8 32382
fastcgi_pass_header
section 3238
1 32717
fastcgi_pass_request_body
section 3238
2 32718
fastcgi_pass_request_body
section 3271
7 33073
fastcgi_pass_request_headers
section 3271
8 33074
fastcgi_pass_request_headers
section 3307
3 33525
fastcgi_read_timeout
section 3307
4 33526
fastcgi_read_timeout
section 3352
5 34205
fastcgi_request_buffering
section 3352
6 34206
fastcgi_request_buffering
section 3420
5 34717
fastcgi_send_lowat
section 3420
6 34718
fastcgi_send_lowat
section 3471
7 35167
fastcgi_send_timeout
section 3471
8 35168
fastcgi_send_timeout
section 3516
7 36069
fastcgi_split_path_info
section 3516
8 36070
fastcgi_split_path_info
section 360
69 37739
fastcgi_store
section 360
70 37740
fastcgi_store
section 377
39 38229
fastcgi_store_access
section 377
40 38230
fastcgi_store_access
section 382
29 38802
fastcgi_temp_file_write_size
section 382
30 38803
fastcgi_temp_file_write_size
section 3880
2 39574
fastcgi_temp_path
section 3880
3 39575
fastcgi_temp_path
section 3957
4 40042
parameters passed to a fastcgi server
section 3957
5 40043
parameters passed to a fastcgi server
section 4004
2 41202
embedded variables
section 4004
3 41203
embedded variables
section 4022
1 41012
$fastcgi_script_name
section 4022
2 41013
$fastcgi_script_name
section 4101
2 41202
$fastcgi_path_info
section 4101
3 41203
$fastcgi_path_info
module ngx_http_flv_module
module ngx_http_flv_module
aliases ngx_flv
aliases ngx_flv
...
@@ -698,13 +698,13 @@ module ngx_http_hls_module
...
@@ -698,13 +698,13 @@ module ngx_http_hls_module
aliases ngx_hls
aliases ngx_hls
section 17 1284 name
section 17 1284 name
section 1284 1850 example configuration
section 1284 1850 example configuration
section 1850 56
59
directives
section 1850 56
61
directives
section 1869 1972 hls
section 1869 1972 hls
section 1972 2256 hls_buffers
section 1972 2256 hls_buffers
section 2256 4
598
hls_forward_args
section 2256 4
600
hls_forward_args
section 4
598 4861
hls_fragment
section 4
600 4863
hls_fragment
section 486
1 5122
hls_mp4_buffer_size
section 486
3 5124
hls_mp4_buffer_size
section 512
2 5659
hls_mp4_max_buffer_size
section 512
4 5661
hls_mp4_max_buffer_size
module ngx_http_image_filter_module
module ngx_http_image_filter_module
aliases ngx_image_filter
aliases ngx_image_filter
...
@@ -734,13 +734,13 @@ module ngx_http_index_module
...
@@ -734,13 +734,13 @@ module ngx_http_index_module
module ngx_http_js_module
module ngx_http_js_module
aliases ngx_js
aliases ngx_js
section 17
796
name
section 17
351
name
section
796 2255
example configuration
section
351 2080
example configuration
section 2
255 2771
directives
section 2
080 2596
directives
section 2
274 2455
js_content
section 2
099 2280
js_content
section 2
455 2618
js_include
section 2
280 2443
js_include
section 2
618 2771
js_set
section 2
443 2596
js_set
section 2
771 2906 request and response arguments
section 2
596 2701 request argument
module ngx_http_keyval_module
module ngx_http_keyval_module
aliases ngx_keyval
aliases ngx_keyval
...
@@ -835,10 +835,10 @@ module ngx_http_memcached_module
...
@@ -835,10 +835,10 @@ module ngx_http_memcached_module
module ngx_http_mirror_module
module ngx_http_mirror_module
aliases ngx_mirror
aliases ngx_mirror
section 17 281 name
section 17 281 name
section 281 51
1
example configuration
section 281 51
3
example configuration
section 51
1 1696
directives
section 51
3 1700
directives
section 53
0 811
mirror
section 53
2 813
mirror
section 81
1 1696
mirror_request_body
section 81
3 1700
mirror_request_body
module ngx_http_mp4_module
module ngx_http_mp4_module
aliases ngx_mp4
aliases ngx_mp4
...
@@ -1141,7 +1141,7 @@ module ngx_http_ssi_module
...
@@ -1141,7 +1141,7 @@ module ngx_http_ssi_module
section 1556 1895 ssi_silent_errors
section 1556 1895 ssi_silent_errors
section 1895 2253 ssi_types
section 1895 2253 ssi_types
section 2253 2489 ssi_value_length
section 2253 2489 ssi_value_length
section 2489 793
1
ssi commands
section 2489 793
2
ssi commands
section 2683 2865 block
section 2683 2865 block
section 2865 2992 name
section 2865 2992 name
section 2992 3079 config
section 2992 3079 config
...
@@ -1158,13 +1158,13 @@ module ngx_http_ssi_module
...
@@ -1158,13 +1158,13 @@ module ngx_http_ssi_module
section 5626 5972 virtual
section 5626 5972 virtual
section 5972 6397 stub
section 5972 6397 stub
section 6397 6633 wait
section 6397 6633 wait
section 6633 765
7
set
section 6633 765
8
set
section 765
7 7754
set
section 765
8 7755
set
section 775
4 7793
var
section 775
5 7794
var
section 779
3 7931
value
section 779
4 7932
value
section 793
1 8310
embedded variables
section 793
2 8311
embedded variables
section 803
7 8176
$date_local
section 803
8 8177
$date_local
section 817
6 8310
$date_gmt
section 817
7 8311
$date_gmt
module ngx_http_ssl_module
module ngx_http_ssl_module
aliases ngx_ssl
aliases ngx_ssl
...
@@ -1358,22 +1358,22 @@ module ngx_http_status_module
...
@@ -1358,22 +1358,22 @@ module ngx_http_status_module
module ngx_http_stub_status_module
module ngx_http_stub_status_module
aliases ngx_stub_status
aliases ngx_stub_status
section 17 331 name
section 17 331 name
section 331 6
79
example configuration
section 331 6
81
example configuration
section 6
79 995
directives
section 6
81 997
directives
section
698 995
stub_status
section
700 997
stub_status
section 99
5 1852
data
section 99
7 1854
data
section 106
6 1183
active connections
section 106
8 1185
active connections
section 118
3 1256
accepts
section 118
5 1258
accepts
section 125
6 1469
handled
section 125
8 1471
handled
section 14
69 1531
requests
section 14
71 1533
requests
section 153
1 1632
reading
section 153
3 1634
reading
section 163
2 1746
writing
section 163
4 1748
writing
section 174
6 1852
waiting
section 174
8 1854
waiting
section 185
2 2276
embedded variables
section 185
4 2278
embedded variables
section 198
5 2062
$connections_active
section 198
7 2064
$connections_active
section 206
2 2129
$connections_reading
section 206
4 2131
$connections_reading
section 21
29 2196
$connections_writing
section 21
31 2198
$connections_writing
section 219
6 2276
$connections_waiting
section 219
8 2278
$connections_waiting
module ngx_http_sub_module
module ngx_http_sub_module
aliases ngx_sub
aliases ngx_sub
...
@@ -1420,7 +1420,7 @@ module ngx_http_upstream_module
...
@@ -1420,7 +1420,7 @@ module ngx_http_upstream_module
aliases ngx_upstream
aliases ngx_upstream
section 17 387 name
section 17 387 name
section 387 1639 example configuration
section 387 1639 example configuration
section 1639 2
4710
directives
section 1639 2
5325
directives
section 1658 2738 upstream
section 1658 2738 upstream
section 2738 8252 server
section 2738 8252 server
section 8252 9081 zone
section 8252 9081 zone
...
@@ -1432,29 +1432,30 @@ module ngx_http_upstream_module
...
@@ -1432,29 +1432,30 @@ module ngx_http_upstream_module
section 16036 16472 least_conn
section 16036 16472 least_conn
section 16472 17437 least_time
section 16472 17437 least_time
section 17437 18336 queue
section 17437 18336 queue
section 18336 24290 sticky
section 18336 18951 random
section 19000 20413 cookie
section 18951 24905 sticky
section 20413 20710 expires=time
section 19615 21028 cookie
section 20710 20848 domain=domain
section 21028 21325 expires=time
section 20848 20928 httponly
section 21325 21463 domain=domain
section 20928 21005 secure
section 21463 21543 httponly
section 21005 21179 path=path
section 21543 21620 secure
section 21179 22577 route
section 21620 21794 path=path
section 22577 24290 learn
section 21794 23192 route
section 24290 24710 sticky_cookie_insert
section 23192 24905 learn
section 24710 28504 embedded variables
section 24905 25325 sticky_cookie_insert
section 24831 25517 $upstream_addr
section 25325 29119 embedded variables
section 25517 25731 $upstream_bytes_received
section 25446 26132 $upstream_addr
section 25731 25976 $upstream_cache_status
section 26132 26346 $upstream_bytes_received
section 25976 26314 $upstream_connect_time
section 26346 26591 $upstream_cache_status
section 26314 26541 $upstream_cookie_i<name>
section 26591 26929 $upstream_connect_time
section 26541 26831 $upstream_header_time
section 26929 27156 $upstream_cookie_i<name>
section 26831 27249 $upstream_http_i<name>
section 27156 27446 $upstream_header_time
section 27249 27513 $upstream_queue_time
section 27446 27864 $upstream_http_i<name>
section 27513 27773 $upstream_response_length
section 27864 28128 $upstream_queue_time
section 27773 28049 $upstream_response_time
section 28128 28388 $upstream_response_length
section 28049 28359 $upstream_status
section 28388 28664 $upstream_response_time
section 28359 28504 $upstream_trailer_i<name>
section 28664 28974 $upstream_status
section 28974 29119 $upstream_trailer_i<name>
module ngx_http_userid_module
module ngx_http_userid_module
aliases ngx_userid
aliases ngx_userid
...
@@ -1690,38 +1691,38 @@ module ngx_stream_access_module
...
@@ -1690,38 +1691,38 @@ module ngx_stream_access_module
module ngx_stream_core_module
module ngx_stream_core_module
section 17 283 name
section 17 283 name
section 283 1262 example configuration
section 283 1262 example configuration
section 1262 9
557
directives
section 1262 9
650
directives
section 1281 6
028
listen
section 1281 6
121
listen
section 6
028 6296
preread_buffer_size
section 6
121 6389
preread_buffer_size
section 6
296 6561
preread_timeout
section 6
389 6654
preread_timeout
section 6
561 6927
proxy_protocol_timeout
section 6
654 7020
proxy_protocol_timeout
section
6927 7934
resolver
section
7020 8027
resolver
section
7934 8314
resolver_timeout
section
8027 8407
resolver_timeout
section 8
314 8422
server
section 8
407 8515
server
section 8
422 8584
stream
section 8
515 8677
stream
section 8
584 8907
tcp_nodelay
section 8
677 9000
tcp_nodelay
section
8907 9231
variables_hash_bucket_size
section
9000 9324
variables_hash_bucket_size
section 9
231 9557
variables_hash_max_size
section 9
324 9650
variables_hash_max_size
section 9
557 12126
embedded variables
section 9
650 12219
embedded variables
section 9
666 9820
$binary_remote_addr
section 9
759 9913
$binary_remote_addr
section 9
820 9900
$bytes_received
section 9
913 9993
$bytes_received
section 99
00 9961
$bytes_sent
section 99
93 10054
$bytes_sent
section
9961 10014
$connection
section
10054 10107
$connection
section 10
014 10050
$hostname
section 10
107 10143
$hostname
section 10
050 10129
$msec
section 10
143 10222
$msec
section 10
129 10174
$nginx_version
section 10
222 10267
$nginx_version
section 10
174 10221
$pid
section 10
267 10314
$pid
section 10
221 10319
$protocol
section 10
314 10412
$protocol
section 10
319 10563
$proxy_protocol_addr
section 10
412 10656
$proxy_protocol_addr
section 10
563 10804
$proxy_protocol_port
section 10
656 10897
$proxy_protocol_port
section 108
04 10848
$remote_addr
section 108
97 10941
$remote_addr
section 10
848 10889
$remote_port
section 10
941 10982
$remote_port
section 10
889 11148
$server_addr
section 10
982 11241
$server_addr
section 11
148 11224
$server_port
section 11
241 11317
$server_port
section 11
224 11323
$session_time
section 11
317 11416
$session_time
section 11
323 11976
$status
section 11
416 12069
$status
section 1
1976 12049
$time_iso8601
section 1
2069 12142
$time_iso8601
section 12
049 12126
$time_local
section 12
142 12219
$time_local
module ngx_stream_geo_module
module ngx_stream_geo_module
section 17 212 name
section 17 212 name
...
@@ -1757,15 +1758,15 @@ module ngx_stream_geoip_module
...
@@ -1757,15 +1758,15 @@ module ngx_stream_geoip_module
section 3557 3667 $geoip_org
section 3557 3667 $geoip_org
module ngx_stream_js_module
module ngx_stream_js_module
section 17
780
name
section 17
335
name
section
780 3088
example configuration
section
335 2705
example configuration
section
3088 3973
directives
section
2705 3590
directives
section
3107 3310
js_access
section
2724 2927
js_access
section
3310 3449
js_filter
section
2927 3066
js_filter
section 3
449 3612
js_include
section 3
066 3229
js_include
section 3
612 3818
js_preread
section 3
229 3435
js_preread
section 3
818 3973
js_set
section 3
435 3590
js_set
section 3
973 4096
session object properties
section 3
590 3713
session object properties
module ngx_stream_keyval_module
module ngx_stream_keyval_module
section 17 336 name
section 17 336 name
...
@@ -1905,12 +1906,13 @@ module ngx_stream_ssl_module
...
@@ -1905,12 +1906,13 @@ module ngx_stream_ssl_module
module ngx_stream_ssl_preread_module
module ngx_stream_ssl_preread_module
section 17 617 name
section 17 617 name
section 617 1478 example configuration
section 617 1861 example configuration
section 1478 1751 directives
section 1861 2134 directives
section 1497 1751 ssl_preread
section 1880 2134 ssl_preread
section 1751 2025 embedded variables
section 2134 2512 embedded variables
section 1790 1865 $ssl_preread_server_name
section 2173 2277 $ssl_preread_protocol
section 1865 2025 $ssl_preread_alpn_protocols
section 2277 2352 $ssl_preread_server_name
section 2352 2512 $ssl_preread_alpn_protocols
module ngx_stream_upstream_hc_module
module ngx_stream_upstream_hc_module
section 17 752 name
section 17 752 name
...
@@ -1923,7 +1925,7 @@ module ngx_stream_upstream_hc_module
...
@@ -1923,7 +1925,7 @@ module ngx_stream_upstream_hc_module
module ngx_stream_upstream_module
module ngx_stream_upstream_module
section 17 264 name
section 17 264 name
section 264 1528 example configuration
section 264 1528 example configuration
section 1528 1
1610
directives
section 1528 1
2231
directives
section 1547 2641 upstream
section 1547 2641 upstream
section 2641 7401 server
section 2641 7401 server
section 7401 8184 zone
section 7401 8184 zone
...
@@ -1931,13 +1933,14 @@ module ngx_stream_upstream_module
...
@@ -1931,13 +1933,14 @@ module ngx_stream_upstream_module
section 9087 10215 hash
section 9087 10215 hash
section 10215 10571 least_conn
section 10215 10571 least_conn
section 10571 11610 least_time
section 10571 11610 least_time
section 11610 13224 embedded variables
section 11610 12231 random
section 11733 12117 $upstream_addr
section 12231 13845 embedded variables
section 12117 12310 $upstream_bytes_sent
section 12354 12738 $upstream_addr
section 12310 12513 $upstream_bytes_received
section 12738 12931 $upstream_bytes_sent
section 12513 12758 $upstream_connect_time
section 12931 13134 $upstream_bytes_received
section 12758 13006 $upstream_first_byte_time
section 13134 13379 $upstream_connect_time
section 13006 13224 $upstream_session_time
section 13379 13627 $upstream_first_byte_time
section 13627 13845 $upstream_session_time
module ngx_stream_zone_sync_module
module ngx_stream_zone_sync_module
section 17 569 name
section 17 569 name
...
@@ -1977,91 +1980,125 @@ module njs_about
...
@@ -1977,91 +1980,125 @@ module njs_about
module njs_api
module njs_api
section 18 159 name
section 18 159 name
section 159 3563 core
section 159 15474 core
section 173 1892 json
section 173 8163 string
section 292 584 c<json.parse(string[,
section 1435 1634 c<string.fromcodepoint(codepoint1[, ...[,
section 584 1892 c<json.stringify(value[,
section 1634 1829 c<string.prototype.concat(string1[, ...,
section 1892 3563 crypto
section 1829 2210 c<string.prototype.endswith(searchstring[,
section 2050 2263 crypto.createhash(algorithm)
section 2210 2411 c<string.prototype.frombytes(start[,
section 2263 2492 c<crypto.createhmac(algorithm,
section 2411 2602 c<string.prototype.fromutf8(start[,
section 2492 3024 hash
section 2602 2944 c<string.prototype.includes(searchstring[,
section 2517 2609 hash.update(data)
section 2944 3423 c<string.prototype.indexof(searchstring[,
section 2609 3024 hash.digest([encoding])
section 3423 3766 c<string.prototype.lastindexof(searchstring[,
section 3024 3563 hmac
section 3766 3879 string.prototype.length
section 3049 3141 hmac.update(data)
section 3879 4017 string.prototype.match([regexp])
section 3141 3563 hmac.digest([encoding])
section 4017 4188 string.prototype.repeat(number)
section 3563 6725 http
section 4188 4476 c<string.prototype.replace([regexpe<verbar>string[,
section 3678 5211 request
section 4476 4618 string.prototype.search([regexp])
section 3706 3766 req.uri
section 4618 4872 c<string.prototype.slice(start[,
section 3766 3819 req.method
section 4872 5273 c<string.prototype.startswith(searchstring[,
section 3819 3875 req.httpversion
section 5273 5514 c<string.prototype.substr(start[,
section 3875 3935 req.remoteaddress
section 5514 5741 c<string.prototype.substring(start[,
section 3935 4127 req.headers{}
section 5741 5928 c<string.prototype.tobytes(start[,
section 4127 4190 req.args{}
section 5928 6110 string.prototype.tolowercase()
section 4190 4260 request.variables{}
section 6110 6458 string.prototype.tostring([encoding])
section 4260 4328 req.response
section 6458 6640 string.prototype.touppercase()
section 4328 4434 req.log(string)
section 6640 6866 c<string.prototype.toutf8(start[,
section 4434 4552 req.warn(string)
section 6866 6995 string.prototype.trim()
section 4552 4669 req.error(string)
section 6995 7282 c<string.prototype.split(([stringe<verbar>regexp[,
section 4669 5021 c<req.subrequest(uri[,
section 7282 7548 encodeuri(uri)
section 5021 5059 args
section 7548 7824 encodeuricomponent(encodeduristring)
section 5059 5093 body
section 7824 7974 decodeuri(encodeduri)
section 5093 5211 method
section 7974 8163 decodeuricomponent(decodeduristring)
section 5211 6052 response
section 8163 9882 json
section 5240 5293 res.status
section 8282 8574 c<json.parse(string[,
section 5293 5347 res.headers{}
section 8574 9882 c<json.stringify(value[,
section 5347 5437 res.contenttype
section 9882 11553 crypto
section 5437 5531 res.contentlength
section 10040 10253 crypto.createhash(algorithm)
section 5531 5600 res.sendheader()
section 10253 10482 c<crypto.createhmac(algorithm,
section 5600 5687 res.send(string)
section 10482 11014 hash
section 5687 5758 res.finish()
section 10507 10599 hash.update(data)
section 5758 6052 res.return(status[, string])
section 10599 11014 hash.digest([encoding])
section 6052 6725 reply
section 11014 11553 hmac
section 6078 6138 reply.uri
section 11039 11131 hmac.update(data)
section 6138 6191 reply.method
section 11131 11553 hmac.digest([encoding])
section 6191 6243 reply.status
section 11553 12078 timers
section 6243 6335 reply.contenttype
section 11581 11678 cleartimeout(timeout)
section 6335 6431 reply.contentlength
section 11678 12078 c<settimeout(function,
section 6431 6584 reply.headers{}
section 12078 15474 file system
section 6584 6646 reply.body
section 12216 12502 c<appendfilesync(filename,
section 6646 6725 reply.parent
section 12502 12559 mode
section 6725 7891 stream
section 12559 12629 flag
section 6848 7891 session
section 12629 13022 c<readfilesync(filename[,
section 6876 6934 s.remoteaddress
section 13022 13114 encoding
section 6934 7032 s.eof
section 13114 13367 flag
section 7032 7162 s.fromupstream
section 13367 13681 c<writefilesync(filename,
section 7162 7216 s.buffer
section 13681 13738 mode
section 7216 7280 s.variables{}
section 13738 13951 flag
section 7280 7323 s.ok
section 13951 15474 file system flags
section 7323 7378 s.declined
section 15474 18274 http request
section 7378 7427 s.again
section 15660 15721 r.args{}
section 7427 7476 s.error
section 15721 15828 r.error(string)
section 7476 7525 s.abort
section 15828 15897 r.finish()
section 7525 7637 s.log(string)
section 15897 16070 r.headersin{}
section 7637 7758 s.warn(string)
section 16070 16245 r.headersout{}
section 7758 7891 s.error(string)
section 16245 16299 r.httpversion
section 7891 11671 examples
section 16299 16403 r.log(string)
section 7909 8146 url decoding
section 16403 16585 r.internalredirect(uri)
section 8146 8475 url encoding
section 16585 16633 r.method
section 8475 9125 returning fastest response from proxy
section 16633 16695 r.parent
section 9125 9957 creating hs jwt
section 16695 16753 r.remoteaddress
section 9957 11067 accessing api from a subrequest
section 16753 16817 r.requestbody
section 11067 11671 creating secure_link hash
section 16817 16978 r.responsebody
section 16978 17249 r.return(status[, string])
section 17249 17334 r.send(string)
section 17334 17402 r.sendheader()
section 17402 17444 r.status
section 17444 17508 r.variables{}
section 17508 17616 r.warn(string)
section 17616 17661 r.uri
section 17661 18002 c<r.subrequest(uri[,
section 18002 18040 args
section 18040 18074 body
section 18074 18274 method
section 18274 19467 stream session
section 18468 18526 s.remoteaddress
section 18526 18624 s.eof
section 18624 18754 s.fromupstream
section 18754 18808 s.buffer
section 18808 18872 s.variables{}
section 18872 18915 s.ok
section 18915 18970 s.declined
section 18970 19019 s.again
section 19019 19068 s.error
section 19068 19117 s.abort
section 19117 19229 s.log(string)
section 19229 19342 s.warn(string)
section 19342 19467 s.error(string)
section 19467 23480 examples
section 19485 19713 url decoding
section 19713 20035 url encoding
section 20035 20336 internal redirect
section 20336 20971 returning fastest response from proxy
section 20971 21796 creating hs jwt
section 21796 22885 accessing api from a subrequest
section 22885 23480 creating secure_link hash
module njs_changes
module njs_changes
section 18 60 name
section 18 60 name
section 60 1747 changes with 0.2.1
section 60 1270 changes with 0.2.2
section 1747 2499 changes with 0.2.0
section 1270 2957 changes with 0.2.1
section 2499 3158 changes with 0.1.15
section 2957 3709 changes with 0.2.0
section 3158 3503 changes with 0.1.14
section 3709 4368 changes with 0.1.15
section 3503 3979 changes with 0.1.13
section 4368 4713 changes with 0.1.14
section 3979 4156 changes with 0.1.12
section 4713 5189 changes with 0.1.13
section 4156 4992 changes with 0.1.11
section 5189 5366 changes with 0.1.12
section 4992 5359 changes with 0.1.10
section 5366 6202 changes with 0.1.11
section 5359 5532 changes with 0.1.9
section 6202 6569 changes with 0.1.10
section 5532 6042 changes with 0.1.8
section 6569 6742 changes with 0.1.9
section 6042 6369 changes with 0.1.7
section 6742 7252 changes with 0.1.8
section 6369 6691 changes with 0.1.6
section 7252 7579 changes with 0.1.7
section 7579 7901 changes with 0.1.6
module request_processing
module request_processing
section 18 85 name
section 18 85 name
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment