企业架构LNMP学习笔记19

发布于:2023-09-09 ⋅ 阅读:(135) ⋅ 点赞:(0)

Nginx 第三方模块的使用:

Nginx官方没有的功能,开源开发人员定制开发了一些功能,把代码公布出来,可以通过编译加载第三方模块的方式,使用新功能。

NGINX 3rd Party Modules | NGINX

shell > tar xvf ngx-fancyindex-v0.4.3.tar.gz
shell > tar xvf echo-nginx-module-0.61.tar.gz
shell > cd /root/soft/nginx-1.24.0
shell > ./configure  --prefix=/usr/local/nginx --user=www --group=www --with-http_ssl_module --with-http_stub_status_module --with-http_realip_module --add-module=/root/soft/ngx-fancyindex-0.4.3/ --add-module=/root/soft/echo-nginx-module-0.61
shell > make && make install && make upgrade

 --add-module: enable external module   (启动第三方模块)

查看确认编译模块参数:

[root@server01 sbin]# ll
total 12648
-rwxr-xr-x 1 root root 6822160 Sep  6 22:53 nginx
-rwxr-xr-x 1 root root 6123912 Sep  4 00:56 nginx.old
[root@server01 sbin]# ./nginx -V
nginx version: nginx/1.24.0
built by gcc 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC)
built with OpenSSL 1.0.2k-fips  26 Jan 2017
TLS SNI support enabled
configure arguments: --prefix=/usr/local/nginx --user=www --group=www --with-http_ssl_module --with-http_stub_status_module --with-http_realip_module --add-module=/root/soft/ngx-fancyindex-0.4.3/ --add-module=/root/soft/echo-nginx-module-0.61

确认是否包含ngx-fancyindex模块。

 

验证是否一下$document_root是否和root设定的值一致。


网站公告

今日签到

点亮在社区的每一天
去签到