http server location
absolute_redirect on | off; 默认开启 绝对路径重定向
server_name_in_redirect on | off;
port_in_redirect on | off;
aio on | off | threads[=pool]; 使用异步文件IO,在Linux下需要搭配使用directio(否则读取时阻塞的 同时只能读取512byte边界或4K在XFS中的需要设置directio_alignment 否则会阻塞),对于大于等于directio指定的大小使用AIO,否则用sendfile
sendfile on;
aio on;
directio 8m;
另外可使用多线程来处理,不会阻塞worker进程
aio_write on | off; 是否异步写文件,当前需要用aio threads,且只能适用从代理的服务器的数据写到临时文件
alias 适用于location
location /i/ {
alias /data/w3/images/;
}
auth_delay 0s; 对于未认证的请求延迟一下避免被破解
chunked_transfer_encoding on | off;
client_body_buffer_size size;
client_body_in_file_only on | clean | off;
client_body_in_single_buffer on | off;
client_body_temp_path path [level1 [level2 [level3]]];
client_body_timeout time;
client_header_buffer_size size;
client_header_timeout time;
client_max_body_size size; 这个比较重要
connection_pool_size size;
default_type mime-type;
disable_symlinks off; 对于autoindex randomindex dav会忽略这个配置
error_page 404 /404.html;
etag on | off; 默认有
if_modified_since off | exact | before;
ignore_invalid_headers on | off;
location 只能被内部请求来访问,用于error_page index random_index try_files重定向,X-Accel-Redirect重定向,include virtual的子请求(nginx_http_ssi_module ngx_http_addition_module),auth_request mirror的子请求,通过rewrite指令的
keepalive_disable none | browser ...; 禁用某些浏览器的keep alive特性
keepalive_requests number; 一个长连接能服务的最大请求数量
keepalive_time time; 长连接最仓连接时间
keepalive_timeout timeout [header_timeout];
large_client_header_buffers number size;
limit_except method ... { ... }
limit_rate rate;
limit_rate_after size;
lingering_close off | on | always;
lingering_time time;
lingering_timeout time;
listen 在server中定义
log_not_found on | off;
log_subrequest on | off;
max_ranges number;
merge_slashes on | off;
msie_padding on | off;
msie_refresh on | off;
open_file_cache off;
open_file_cache_errors on | off;
open_file_cache_min_uses number;
open_file_cache_valid time;
output_buffers number size;
port_in_redirect on | off;
postpone_output size;
read_ahead size;
recursive_error_pages on | off;
request_pool_size size;
reset_timedout_connection on | off;
resolver
resolver_timeout time;
root path;
satisfy all | any; 针对限制条件之间的关系定义
send_lowat size;
send_timeout time;
sendfile on | off;
sendfile_max_chunk size;
tcp_nodelay on | off;
tcp_nopush on | off;
网友评论