本文介绍 Nginx 编译时 configure 的基本参数。
# 安装目录 --prefix=/home/nginx / # 编译目录 --builddir=/home/nginx-installation/build / # 主程序目录 --sbin-path=/home/nginx/sbin/nginx / # modules 目录 --modules-path=/home/nginx/modules / # pid 目录 --pid-path=/home/nginx/sbin/nginx.pid / # 配置文件目录 --conf-path=/home/nginx/conf/nginx.conf / # 错误日志目录 --error-log-path=/home/nginx/logs/error.log / # lock 目录(nginx.lock,安装文件锁定,防止安装文件被别人利用,或自己误操作) --lock-path=/home/nginx/lock/nginx.lock / # http 客户端请求 临时文件路径 --http-client-body-temp-path=/home/nginx/temp/client_body / # http 代理 临时文件路径 --http-proxy-temp-path=/home/nginx/temp/proxy / # 指定 pcre 库、zlib 库、openssl 库 --with-pcre=/home/nginx-installation/pcre-8.37 / --with-zlib=/home/nginx-installation/zlib-1.2.11 / --with-openssl=/home/nginx-installation/openssl-draft-18 / # TLS 1.3 --with-openssl-opt=enable-tls1_3 / # SSL 模块 --with-http_ssl_module / # HTTP/2 --with-http_v2_module / # 允许从请求头更改客户端的 IP 地址值 --with-http_realip_module / # gzip 压缩 --with-http_gzip_static_module / # un-gzip 解压缩 --with-http_gunzip_module / # 允许替换字符串、允许多个 subfilter 匹配规则 --with-http_sub_module / --add-module=/home/nginx-installation/ngx_http_substitutions_filter_module / # stub_status 监控页面(获取 nginx 自上次启动以来的工作状态) --with-http_stub_status_module / # 启用 file aio 支持(一种 APL 文件传输格式) --with-file-aio / # 启用 debug 日志 --with-debug / # 允许在内存不足的情况下返回 204 或 444 码 --with-http_degradation_module / # 启用 ngx_access_key_module --add-module=/home/nginx-installation/access-key-module-2.0.3 / # 在响应之前或者之后追加文本内容 --with-http_addition_module / # 提供[寻求内存使用基于时间的偏移量]文件 --with-http_flv_module / # 增加 PUT,DELETE,MKCOL:创建集合, COPY 和 MOVE 方法 --with-http_dav_module / # 启用 POP3/IMAP4/SMTP 代理模块支持 --with-mail / # 启用 ngx_mail_ssl_module --with-mail_ssl_module / # 启用 ipv6 支持 --with-ipv6 / # 过滤转换 XML 请求 --with-http_xslt_module / # JPEG/GIF/PNG 图片传输的一个拓展。需要 gd 库支持 --with-http_image_filter_module / # 该模块创建基于与 MaxMind GeoIP 二进制文件相配的客户端 IP 地址的 ngx_http_geoip_module 变量 --with-http_geoip_module / # 从目录中随机挑选一个目录索引 --with-http_random_index_module / # 计算和检查要求所需的安全链接网址 --with-http_secure_link_module / # 使 nginx 可以直接使用 perl 或通过 ssi 调用 perl --with-http_perl_module / # 指定 perl 模块路径 --with-perl_modules_path= ... / # 指定 perl 库文件路径 --with-perl= ... / # 调试用,剖析程序性能瓶颈 --with-google_perftools_module / # 指向 C 编译器路径 --with-cc= ... / # 设置 C 编译器参数 --with-cc-opt= xxx / # 指向 C 预处理路径 --with-cpp= ... / # 启用 ngx_cpp_test_module --with-cpp_test_module / # 设置连接文件参数 --with-ld-opt= xxx / # 指定编译的 CPU --with-cpu-opt= xxx / # 禁用 ngx_http_fastcgi_module(该模块允许 Nginx 与 FastCGI 进程交互,并通过传递参数来控制 FastCGI 进程工作。FastCGI 是一个常驻型的公共网关接口) --without-http_fastcgi_module / ##--http-fastcgi-temp-path=/home/nginx/temp/fastcgi / # 禁用 ngx_http_scgi_module(该模块用来启用 SCGI 协议支持,SCGI 协议是 CGI 协议的替代。它是一种应用程序与 HTTP 服务接口标准。它有些像 FastCGI 但他的设计更容易实现) --without-http_scgi_module / ##--http-scgi-temp-path=/home/nginx/temp/scgi / # 禁用 ngx_http_uwsgi_module(该模块用来 uwsgi 协议,uWSGI 服务器相关) --without-http_uwsgi_module / ##--http-uwsgi-temp-path=/home/nginx/temp/uwsgi / # 禁用 ngx_http_autoindex_module(该模块用于自动生成目录列表,若禁用这个 autoindex 则表示只在 ngx_http_index_module 模块未找到索引文件时发出请求) --without-http_autoindex_module / # 禁用 ngx_http_charset_module(重新编码 web 页面,但只能是一个方向[服务器端到客户端],并且只有一个字节的编码可以被重新编码) --without-http_charset_module / # 禁用 ngx_http_empty_gif_module(该模块在内存中常驻了一个 1*1 的透明GIF图像,可以被非常快速的调用) --without-http_empty_gif_module / # 禁用 pop3 协议 --without-mail_pop3_module / # 禁用 imap 协议 --without-mail_imap_module / # 禁用 smtp 协议 --without-mail_smtp_module / # 禁用 http server 功能 --without-http / # 禁用 http cache 功能 --without-http-cache / # 禁用 ngx_http_ssi_module(该模块提供了一个在输入端处理服务器包含文件(SSI)的过滤器,目前支持 SSI 命令的列表是不完整的) --without-http_ssi_module / # 禁用 ngx_http_userid_module(该模块用来确定客户端后续请求的 cookies) --without-http_userid_module / # 禁用 ngx_http_access_module(该模块提供了一个简单的基于主机的访问控制。允许/拒绝基于 ip 地址) --without-http_access_module / # 禁用 ngx_http_limit_zone_module(该模块可以针对条件,进行会话的并发连接数控制) --without-http_limit_zone_module / # 禁用 ngx_http_limit_req_module(该模块允许你对于一个地址进行请求数量的限制用一个给定的 session 或一个特定的事件) --without-http_limit_req_module / # 禁用 ngx_http_auth_basic_module(该模块是可以使用用户名和密码基于 http 基本认证方法来保护你的站点或其部分内容) --without-http_auth_basic_module / # 禁用 ngx_http_geo_module(创建一些变量,其值依赖于客户端的 IP 地址) --without-http_geo_module / # 禁用 ngx_http_map_module(使用任意的键/值对设置配置变量) --without-http_map_module / # 禁用 ngx_http_browser_module(该模块用来创建依赖于 browser 请求报头的值。例如,如果浏览器为 MSIE 中的任意版本,则 $msie 等于 1 ) --without-http_browser_module / # 禁用 ngx_http_split_clients_module(该模块用来基于某些条件划分用户。条件如:ip 地址、报头、cookies 等等) --without-http_split_clients_module / # 禁用 ngx_http_referer_module(该模块用来过滤请求,拒绝报头中 Referer 值不正确的请求) --without-http_referer_module / # 禁用 ngx_http_rewrite_module(该模块用于 rewrite 重定向) --without-http_rewrite_module / # 禁用 ngx_http_proxy_module(有关代理服务器) --without-http_proxy_module / # 禁用 ngx_http_memcached_module(该模块用来提供简单的缓存,以提高系统效率) --without-http_memcached_module / # 禁用 ngx_http_upstream_ip_hash_module(该模块用于简单的负载均衡) --without-http_upstream_ip_hash_module /
转载请注明:逗比根据地 » Nginx 编译参数基本大全