nginx中编译安装的的模块介绍

nginx中编译安装的的模块介绍

./configure --prefix=/usr/local/nginx --with-http_dav_module --with-http_stub_status_module --with-http_addition_module --with-http_sub_module --with-http_flv_module --with-http_mp4_module --with-pcre --with-http_ssl_module --with-http_gzip_static_module --user=www --group=www

 相关选项说明:

--with-http_dav_module   # nginx 编译时通过加入“--with-http_dav_module”可以启用对WebDav协议的支持。WebDAV Web-based Distributed Authoring and Versioning) 一种基于 HTTP 1.1协议的通信协议。它扩展了HTTP 1.1,在GETPOSTHEAD等几个HTTP标准方法以外添加了一些新的方法,使应用程序可直接对Web Server直接读写,并支持写文件锁定(Locking)及解锁(Unlock),还可以支持文件的版本控制。即ngx_http_dav_module模块用于通过 WebDAV 协议进行文件管理自动化。该模块处理 HTTP WebDAV PUTDELETEMKCOLCOPY MOVE 方法。

--with-http_stub_status_module  #获取Nginx的状态统计信息

--with-http_addition_module    #向响应内容中追加内容,比如想在站点底部追加一个js或者css,可以使用这个模块来实现,即模块ngx_http_addition_module在响应之前或者之后追加文本内容。

--with-http_sub_module   # ngx_http_sub_module模块是一个过滤器,它修改网站响应内容中的字符串,比如你想把响应内容中的‘iuwai’全部替换成‘aaaaa‘,这个模块已经内置在nginx中,但是默认未安装,需要安装需要加上配置参数:--with-http_sub_module

--with-http_flv_module      #ngx_http_flv_module模块为Flash视频(FLV)文件提供伪流服务器端支持。它会根据指定的 start 参数来指定跳过多少字节,并在返回数据前面附上 FLV 头。

location ~ \.flv$ {

    flv;

}

curl localhost/index.flv?start=10

该请求的意思是,从视频文件 index.flv 10个字节开始读取返回,并在返回的数据上附上 FLV 头。

--with-http_mp4_module     #模块提供了对 MP4 视频的播放支持,相关的扩展名 .mp4 .m4v .m4a

--with-http_ssl_module         #启用ngx_http_ssl_module

--with-pcre   # 支持正则表达式

 

注:如果pcre是通过编译安装的话,例如

# tar zxvf /usr/local/src/pcre-8.36.tar.gz -C /usr/local/src/

# cd  /usr/local/src/pcre-8.36

# ./configure && make && make install

--with-pcre=/usr/local/src/pcre-8.36  #需要注意,这里指的是源码,./configure --help |grep pcre查看帮助。

posted @ 2023-07-19 09:48  ღ᭄遇见你²⁰²²  阅读(270)  评论(0)    收藏  举报