下载需要组件6 k! N2 K( T) _8 i! }. O6 {0 s( n1 b
wget http://nginx.org/download/nginx-1.17.7.tar.gz
+ p) R, j( u( @7 B/ Ztar xvzf nginx-1.17.7.tar.gz
4 h1 L( J5 E9 H4 q5 X, F
7 Z* a0 s, L* r; d: Twget https://www.openssl.org/source/openssl-1.1.1d.tar.gz
% \" \$ u3 t. A; j utar xvzf openssl-1.1.1d.tar.gz( s' x) Z8 q1 {% r. t
, @9 F8 A* |3 Owget https://ftp.pcre.org/pub/pcre/pcre-8.43.tar.gz
' M) D2 H6 f: }* a8 ~ Q8 ltar xvzf pcre-8.43.tar.gz
4 ~4 M. e3 J! Z7 x0 y+ Z/ s- p
. n" _' m2 |+ Ewget https://github.com/yaoweibin/ngx ... /archive/master.zip -O ngx_http_substitutions_filter.zip* }, k( p. S, _% h3 b
unzip ngx_http_substitutions_filter.zip: n) d% L3 |+ N5 K3 t
' G2 w' |: I+ D' Z& n+ V8 ~
cd nginx-1.17.7* d/ g- R, ?' Z: ?' O
# j+ A H5 g4 e# u. t# J' v
! ~# F( T- `% Q( T6 G
配置文件
( {7 n1 U9 L& V4 B' ^& t[Shell] 纯文本查看 复制代码 ./configure \
--user=www \
--group=www \
--prefix=/www/webserver/nginx-1.17.7 \
--sbin-path=/www/webserver/nginx-1.17.7/sbin/nginx \
--pid-path=/www/webserver/nginx-1.17.7/logs/nginx.pid \
--conf-path=/www/webserver/nginx-1.17.7/conf/nginx.conf \
--error-log-path=/www/webserver/nginx-1.17.7/logs/error.log \
--http-log-path=/www/webserver/nginx-1.17.7/logs/access.log \
--http-client-body-temp-path=/www/webserver/nginx-1.17.7/temp/client \
--http-proxy-temp-path=/www/webserver/nginx-1.17.7/temp/proxy \
--http-fastcgi-temp-path=/www/webserver/nginx-1.17.7/temp/fcgi \
--http-scgi-temp-path=/www/webserver/nginx-1.17.7/temp/scgi \
--http-uwsgi-temp-path=/www/webserver/nginx-1.17.7/temp/uwsgi \
--with-http_flv_module \
--with-http_stub_status_module \
--with-http_realip_module \
--with-http_ssl_module \
--with-http_v2_module \
--with-http_gzip_static_module \
--with-pcre=/root/pcre-8.43 \
--with-http_sub_module \
--with-http_geoip_module \
--add-module=/root/ngx_http_substitutions_filter_module-master \
--with-openssl=/root/openssl-1.1.1d
( F$ {1 A9 ^% m) p6 v# m编译 make
! C- H! R6 |* |. T9 O6 \- w! K6 {安装 make install- g& y1 O* C6 P# P
|