您的位置:首页 > 理论基础 > 计算机网络

nginx http核心模块指令(二)

2015-08-12 00:05 537 查看


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

指定虚拟主机
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: