转载自http://wiki.nginx.org/ModulesChs#.E6.A0.87.E5.87.86_HTTP_.E6.A8.A1.E5.9D.97
nginx配置参数
安装模块
Nginx 模块必须在编译时就进行选择,目前不支持在运行时进行模块选择。
在编译时,可以通过命令 ./configure --help 运行所提供的配置脚本来查看所有支持的编译选项列表(包含可选模块)。
Nginx 核心模块
这些模块是必须的。
名称 | 说明 |
---|
Main | 配置错误日志、进程、权限等。 | Events | 配置epoll、kqueue、select、poll等。 |
标准 HTTP 模块
这些模块是默认均被编译进去的,除非通过configure 明确地禁用它们。
名称 | 说明 | 版本 | 禁用选项 |
---|
Core | 控制端口、location、错误页、别名和其他必要配置。 | | --without-http | Access | 基于客户端IP地址允许/拒绝Http请求。 | | --without-http_access_module | Auth Basic | Basic HTTP 认证。 | | --without-http_auth_basic_module | Auto Index | 自动为没有索引页面的目录生成文件列表。 | | --without-http_autoindex_module | Browser | 翻译"User-Agent" 字符串。 | 0.4.3 | --without-http_browser_module | Charset | 对Web页面重新编码。 | | --without-http_charset_module | Empty GIF | 在内存中生成一个高1像素、宽1像素的GIF图片,并对外提供服务。 | 0.3.10 | --without-http_empty_gif_module | FastCGI | 提供对FastCGI的支持。 | | --without-http_fastcgi_module | Geo | 通过IP地址的键值对来设置配置参数。 | 0.1.17 | --without-http_geo_module | Gzip | 支持使用Gzip压缩响应内容。 | | --without-http_gzip_module | Headers | 可以设定任意的HTTP响应头。 | | Index | 控制将哪些文件作为索引页面。 | | Limit Requests | 限定客户端创建连接的频率。 | 0.7.20 | --without-http_limit_req_module | Limit Zone | 限定客户端同时建立连接的最大数。从1.1.8起不再推荐使用,建议使用 Limit Conn。 | 0.5.6 | --without-http_limit_zone_module | Limit Conn | 通过配置参数限定客户端的最大并发连接数。 | | --without-http_limit_conn_module | Log | 可以定制访问日志。 | | Map | 以键值对的方式设定任意配置参数。 | 0.3.16 | --without-http_map_module | Memcached | 支持Memcached。 | | --without-http_memcached_module | Proxy | 代理上级服务器。 | | --without-http_proxy_module | Referer | 基于Referer HTTP请求头对请求进行过滤。 | | --without-http_referer_module | Rewrite | 使用正则表达式对请求进行重写。 | | --without-http_rewrite_module | SCGI | 支持SCGI协议。 | 0.8.42 | --without-http_scgi_module | Split Clients | 基于某些条件将客户端分类。 | 0.8.37 | --without-http_split_clients_module | SSI | 支持服务器端的include。 | | --without-http_ssi_module | Upstream | 支持负载均衡。 | | --without-http_upstream_ip_hash_module (ip_hash directive only) | User ID | 发行用户身份标识cookie。 | | --without-http_userid_module | uWSGI | 支持uWSGI协议。 | 0.8.40 | --without-http_uwsgi_module | X-Accel | 类X-Sendfile模块。 | | |
可选 HTTP 模块
下面的模块必须在编译时为 configure 明确地设定相应的启用选项。
名称 | 说明 | 版本 | 启用选项 |
---|
Addition | 可以为页面追加文本。 | | --with-http_addition_module | Degradation | 允许当剩余内存较低时对某些位置的请求返回 204 或 404 状态码。 | 0.8.25 | --with-http_degradation_module | Embedded Perl | 允许在配置文件中使用 Perl。 | 0.3.21 | --with-http_perl_module | FLV | 支持 Flash视频(Flash Streaming Video)。 | 0.4.7 | --with-http_flv_module | GeoIP | 根据来自 MaxMind 的 GeoIP 二进制文件中的信息创建变量。 | 0.8.6, 0.7.63 | --with-http_geoip_module | Google Perftools | 支持 Google 性能工具。 | 0.6.29 | --with-google_perftools_module | Gzip Precompression | 提供预压缩的静态文件。 | 0.6.23 | --with-http_gzip_static_module | Image Filter | 支持使用 Libgd 对图片进行变换。 | 0.7.54 | --with-http_image_filter_module | MP4 | 允许对 mp4 流进行寻址。 | 1.1.3, 1.0.7 | --with-http_mp4_module | Random Index | 允许使目录索引随机化。 | 0.7.15 | --with-http_random_index_module | Real IP | 允许将 nginx 作为后端服务器。 | 0.3.8 | --with-http_realip_module | Secure Link | 允许通过密钥保护指定的文件。 | 0.7.18 | --with-http_secure_link_module | SSL | 支持 HTTPS/SSL。 | | --with-http_ssl_module | Stub Status | 提供查看服务器统计信息的能力。 | 0.1.18 | --with-http_stub_status_module | Substitution | 可以替换页面中的文本。 | | --with-http_sub_module | WebDAV | 支持 WebDAV 穿透。 | 0.3.38 | --with-http_dav_module | XSLT | 允许对页面使用 XSLT 进行后处理。 | 0.7.8 | --with-http_xslt_module |
邮件模块
名称 | 说明 | 配置参数 |
---|
Core | 使 Nginx 能够处理/代理 IMAP、POP3、SMTP协议。 | --with-mail --without-mail_pop3_module --without-mail_imap_module --without-mail_smtp_module | Auth | 使用 Nginx 为邮件服务进行认证。 | Proxy | 使 Nginx 能够代理 IMAP、POP3、SMTP协议。 | SSL | 该模块可以让 POP3/IMAP/SMTP 使用 SSL/TLS。 | --with-mail_ssl_module |
第三方模块和补丁
请参考目录第三方模块。
参考
|