nginx http核心模块指令(二)

来源:互联网 发布:java如何 私有构造方法 编辑:程序博客网 时间:2024/05/24 05:17

directio

syntax: directio [size|off]

default: directio off

context: http, server, location

该指令可以指定一个大小,当读取的文件长度超过该值时将会使用 O_DIRECT (FreeBSD, Linux), F_NOCACHE (Mac OS X) 或者directio() (Solaris)接口来读取文件,提升性能,对于较大文件比较有用。



error_page

syntax: error_page code [ code... ] [ = | =answer-code ] uri | @named_location

default: no

context: http, server, location, if in location

这个指令指定了定位错误时显示的错误页面的位置



index

syntax: index file [file...]

default: index index.html

指定哪个文件为入口文件



keepalive_timeout

syntax: keepalive_timeout [ time ]

default: keepalive_timeout 75

context: http, server, location

心跳超时时间



listen

syntax: listen address:port [ default [ backlog=num | rcvbuf=size | sndbuf=size | accept_filter=filter | deferred | bind | ssl ] ]

default: listen 80

context: server

指定监听的地址和端口



limit_rate_after

syntax: limit_rate_after time

default: limit_rate_after 1m

context: http, server, location, if in location

该指令用于第一部分发送之后限制速度



location

syntax: location [=|~|~*|^~] /uri/ { ... }

default: no

context: server

指定 URI,可以是字符串或正则表达式



root

syntax: root path

default: root html

context: http, server, location, if in location

指定URL根路径




server

syntax: server {...}

default: no

context: http

指定虚拟主机















0 0
原创粉丝点击