分享

HTTP模块(一)

 thy 2009-07-24

指令

Alias

语法:alias file-path|directory-path

默认值:no

Contextlocation

指定指定某个目录为指定的location所使用,但这个指令和root指令相似但不同,因为文档根没有改变,而只是为请求使用文件系统路径

E.g.

Location /i/{

   Alias    /spool/w3/images/;

}

/i/top.gif的请求将被定向到/spool/w3/images/top.gif这个文件,在替代路径中可以使用变量

Alias不能在location中使用正则表达式,一定需要,就使用rewriteroot指令

Client_body_in_file_only

语法:client_body_in_file_only on|off

默认值:client_body_in_file_only off

Contexthttp Serverlocation

此指令可以将用户的http请求bodys存储在文件中,但是当开启此选项时,请求结束后存储文件不会自动清除。

The directive can be used for debugging and for the $r->request_body_file method in the ngx_http_perl_module module.

此指令应用于调试以及在ngx_http_perl_module模块中为$r->request_body_file 方法使用

Client_body_buffer_size

语法: client_body_buffer_size the_size

默认值:8k/16k

Contexthttpserverlocation

此指令限定了客户http请求体的大小,如果请求体的大小大于这个buffer的值,全部body或部分body将会被存储在临时文件里。默认值是两倍页面的大小,视平台而定,一般为8k/16k

Client_body_temp_path

语法:client_body_temp_path dir_path [ level1[level2 [level3 ] ] ]

默认值:client_body_temp

Contexthttpserverlocation

指定存储用户请求体文件的目录,在dir_path中有一个三层子目录的层次

client_body_temp_path  /spool/nginx/client_temp 1 2;

The directory structure will be like this:

/spool/nginx/client_temp/7/45/00000123457

Client_body_timeout

语法:client_body_timeout time

默认值:60

Contexthttpserverlocation

设定从客户端读取http请求体的超时时间

The timeout is set only if a body is not get in one readstep. If after this time the client send nothing, nginx returns error "Request time out" (408).

client_header_buffer_size

syntax: client_header_buffer_size size

default: client_header_buffer_size 1k

context: http, server

Directive sets the headerbuffer size for the request header from client.

   客户请求头部buffer大小

For the overwhelming majority of requests it is completely sufficient a buffer size of 1K. 对于绝大多数的请求1kbuffer已经足够。

However if a big cookie is in the request-header or the request has come from a wap-client the header can not be placed in 1K, therefore, the request-header or a line of request-header is not located completely in this buffer nginx allocate a bigger buffer, the size of the bigger buffer can be set with the instruction large_client_header_buffers.

然而如果request-header中有一个很大的cookie或是这个request来自wap-client,则1k的容量恐怕不够,因此request-header或是request-header的一行不会完全都存储在这个buffer中,而是指定一个更大的buffer,这个buffer可以由large_client_header_buffers指令指定

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多