Nginx http模块(八)

来源:百度文库 编辑:神马文学网 时间:2024/04/27 08:01:12

Port_in_redirect

语法:port_in_redirect [on | off]

默认值:port_in_redirect on

Contexthttp,server,location

允许或阻止nginx处理在重定向的端口暗示

Directive allows or prevents port indication in redirects handled by nginx

Recursive_error_pages

语法:recursive_error_pagess [ on | off ]

默认值:recursive_error_pages off

Contexthttpserverlocation

是否允许使用error_page chain

Root

语法: root path

默认值:root html

Contexthttpserverlocationif in location

为请求指定文档的根,例如

Location /i/ {

     Root   /spool/w3;

}

对在“/i/top.gif”的请求会返回“/spool/w3/i/top.gif,也可以在参数中使用变量

Satisfy_any

语法:satisfy_any [ on | off ]

默认值:satisfy_any off

Context location

指定解决至少一个成功的检测访问,由ngx_http_access_module ngx_http_authz_basic_module执行

Location ./ {

       Satisfy_any on ;

Allow 192.168.1.0/32;

Deny all;

Auth_basic “closed site”;

Auth_basic_user_file conf / htpasswd;

}

Send_timeout

语法:send_timeout the time

默认值:send_timeout 60

Contexthttpserverlocation

指定对客户端响应的超时时间,不是在整个传递和回答之间建立超时,而仅仅是在两个读操作之间建立,如果超过了这个时间,客户端不会得到任何东西,然后nginx关闭连接。

Sendfile

语法:sendfile [ on | off ]

默认值:sendfile off

Contexthttpserverlocation

激活或解除使用sendfile()

Server

语法:server {。。。}

默认值:no

Contexthttp

为虚拟server指定配置,对于ip-based servername-base(在请求title的在“hostline中使用名字)server没有区别。Listen指令为其指定所有ip和端口号,server_name指令指定所有server的名字