!!!其他版本方法一致,除第6步有區別其他命令均一致!!!
寶塔面板使用nginx安裝云鎖開啟web防護后網站打不開是因為需要對nginx進行自編譯,加入云鎖防護模式,以代替web防護。web防護功能與nginx自編譯后功能一樣。
# ps -elf | grep nginx

# cd /www/server/nginx/sbin/
# cp nginx nginx.bak

# cd ~
# wget?https://codeload.github.com/yunsuo-open/nginx-plugin/zip/master?-O nginx-plugin-master.zip

# unzip nginx-plugin-master.zip

# cd nginx-plugin-master/
# pwd

# cd ~
# /www/server/nginx/sbin/nginx -V

備注:將./configure arguents:之后的內容復制到記事本備用
備注:編譯內容為(./configure 上一步記事本中的備用內容 --add-module=/root/nginx-plugin-master)
# cd?/www/server/nginx/src
如下列代碼(下列代碼請勿復制直接使用,根據你服務器回顯的內容為準):
# ./configure --user=www --group=www --prefix=/www/server/nginx --with-
openssl=/www/server/nginx/src/openssl --add-module=/www/server/nginx/src/ngx_devel_kit --add-
module=/www/server/nginx/src/lua_nginx_module --add-module=/www/server/nginx/src/ngx_cache_purge
--with-http_stub_status_module --with-http_ssl_module --with-http_image_filter_module --with-
http_v2_module --with-http_gzip_static_module --with-http_gunzip_module --with-stream --with-
stream_ssl_module --with-ipv6 --with-http_sub_module --with-http_flv_module --with-
http_addition_module --with-http_realip_module --with-http_mp4_module --with-ld-opt=-Wl,-E --add-
module=/root/nginx-plugin-master

以上操作,切記查看路徑是否正確 多數編譯后出問題就出現在這個地方:/www/server/nginx/src(此路徑)
ps:nginx版本號區分(說白了現在用的版本都是大于1.8的,具體怎么計算,算第一個小數點后面的數字比大小,如下)
版本號:Nginx 1.19.2 大于 Nginx 1.8.0 ↑(對比的是版本號中間的那一位數字,例如這次編譯的版本19大于8,這再不明白的話就真懶得講了!!!)
版本號:Nginx 1.18.0 大于 Nginx 1.8.0 ↑
版本號:Nginx 1.16.0 大于 Nginx 1.8.0 ↑
版本號:Nginx 1.14.0 大于 Nginx 1.8.0 ↑
版本號:Nginx 1.12.0 大于 Nginx 1.8.0 ↑
版本號:1.8.0 ↓
(如果是你用的這幾個對比的版本號,直接加 -DHIGHERTHAN8 即可)很多Q群的朋友都在說不用加,但是Nginx的版本號對比方面,對比數字大小并非是靠前的數字。
# vi objs/Makefile
備注:按Insert后找到-Werror -g 添加 -DHIGHERTHAN8 ,添加之后按ESC:wq

以上操作,切記查看路徑是否正確 多數編譯后出問題就出現在這個地方:/www/server/nginx/src(此路徑)
# make
# rm -rf /www/server/nginx/sbin/nginx
# cp objs/nginx /www/server/nginx/sbin/
# service nginx restart
9.到此通過PC端連接到服務器端,在PC端的界面上刷新后可以看到已識別nginx插件(由灰色變為綠色)。ps:如之前開啟了Web防護關閉后可現實自編譯!

http://域名+/?order%20by
瀏覽器執行

