head (output the first part of files)
man head 命令查看
head -[ncqv] file
-n 显示的行数 默认是前10行
-c 每次输出的字节数
-v 输出显示文件名字
-q 输出一直不显示文件名字
head -n 1 test.txt
root@nginx02 ~
# head -n 1 test.txt
dfasfd:
root@nginx02 ~
# head test.txt
dfasfd:
Nginx may terminate a request early with (at least):
400 (Bad Request)
405 (Not Allowed)
408 (Request Timeout)
414 (Request URI Too Large)
494 (Request Headers Too Large)
499 (Client Closed Request)
500 (Internal Server Error)
root@nginx02 ~
# head -2 test.txt
dfasfd:
Nginx may terminate a request early with (at least):
head -v test.txt 输出显示文件名字
root@nginx02 ~
# head -v test.txt
==> test.txt <==
dfasfd:
Nginx may terminate a request early with (at least):
400 (Bad Request)
405 (Not Allowed)
408 (Request Timeout)
414 (Request URI Too Large)
494 (Request Headers Too Large)
499 (Client Closed Request)
500 (Internal Server Error)
head -c 1 test.txt 每次显示多少字节数
root@nginx02 ~
# head -c 1 test.txt
d
root@nginx02 ~
# head -c 2 test.txt
df
root@nginx02 ~
# head -c 2k test.txt
dfasfd:
Nginx may terminate a request early with (at least):
400 (Bad Request)
405 (Not Allowed)
408 (Request Timeout)
414 (Request URI Too Large)
494 (Request Headers Too Large)
499 (Client Closed Request)
500 (Internal Server Error)
501 (Not Implemented)
This means that phases that normally run are skipped, such as the rewrite or access phase. This also means that later phases that are run regardless, e.g. log_by_lua, will not have access to information that is normally set in those phases.
Back to TOC
TODO
cosocket: implement LuaSocket's unconnected UDP API.
port this module to the "datagram" subsystem of NGINX for implementing general UDP servers instead of HTTP servers in Lua. For example,
datagram {
server {
listen 1953;
handler_by_lua '
-- custom Lua code implementing the special UDP server...
';
}
}
shm: implement a "shared queue API" to complement the existing shared dict API.
cosocket: add support in the context of init_by_lua*.
cosocket: implement the bind() method for stream-typed cosockets.
cosocket: pool-based backend concurrency level control: implement automatic connect queueing when the backend concurrency exceeds its connection pool limit.
cosocket: review and merge aviramc's patch for adding the bsdrecv method.
add new API function ngx.resp.add_header to emulate the standard add_header config directive.
review and apply Jader H. Silva's patch for ngx.re.split().
review and apply vadim-pavlov's patch for ngx.location.capture's extra_headers option
use ngx_hash_t to optimize the built-in header look-up process for ngx.req.set_header, ngx.header.HEADER, and etc.
add configure options for different strategies of handling the cosocket connection exceeding in the pools.
add directives to run Lua codes when nginx stops.
add ignore_resp_headers, ignore_resp_body, and ignore_resp options to ngx.location.capture and ngx.location.capture_multi methods, to allow micro performance tuning on the user side.
add automatic Lua code time slicing support by y