http server location
absolute_redirect on | off; 默認(rèn)開啟 絕對路徑重定向
server_name_in_redirect on | off;
port_in_redirect on | off;
aio on | off | threads[=pool]; 使用異步文件IO琢歇,在Linux下需要搭配使用directio(否則讀取時阻塞的 同時只能讀取512byte邊界或4K在XFS中的需要設(shè)置directio_alignment 否則會阻塞),對于大于等于directio指定的大小使用AIO,否則用sendfile
sendfile on;
aio on;
directio 8m;
另外可使用多線程來處理,不會阻塞worker進(jìn)程
aio_write on | off; 是否異步寫文件,當(dāng)前需要用aio threads基跑,且只能適用從代理的服務(wù)器的數(shù)據(jù)寫到臨時文件
alias 適用于location
location /i/ {
alias /data/w3/images/;
}
auth_delay 0s; 對于未認(rèn)證的請求延遲一下避免被破解
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; 默認(rèn)有
if_modified_since off | exact | before;
ignore_invalid_headers on | off;
location 只能被內(nèi)部請求來訪問,用于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; 一個長連接能服務(wù)的最大請求數(shù)量
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; 針對限制條件之間的關(guān)系定義
send_lowat size;
send_timeout time;
sendfile on | off;
sendfile_max_chunk size;
tcp_nodelay on | off;
tcp_nopush on | off;