おそらく、nginxのYUMのアイデアは、新しいモジュールをインストール
公式nginx.org nginxのソースパッケージの同じバージョンをダウンロードしてください
コンパイルしてインストールし、必要なモジュール(個別のダウンロードパッケージを使用してサードパーティのモジュールに対応)を指定
唯一make installをインストールしていない、作るのコンパイルに注意してください。OBJSディレクトリnginxのにコンパイルされた実行可能ファイルを生成します。
nginxの実行ファイルは、CP OBJS / nginxのは/ usr / sbinに/コピーします
まず、ソースパッケージをダウンロード
nginxの-v 1.16.0:ヤムnginxの現在のバージョンをインストールします
現在のnginxの実行可能ファイル:これはnginxのは/ usr / sbinに/ nginxの、このファイルをバックアップすることをお勧め
nginx.org代わりにソースパッケージをダウンロードするには、ここ1.16.0、1.16.1が見つかりません
ダウンロードに抽出します。/usr/local/nginx-1.16.1ディレクトリ
前にバックアップをコンパイルして起動します。
バックアップソースnginxのCPは/ usr / sbinに/ nginxの/usr/sbin/nginx.bak
バックアップコンフィギュレーションファイルnginxのCPを-rの/ etc / nginxの/etc/nginx.bak
第二に、コンパイラの設定パラメータ
ビューnginxのは、すでにモジュールをインストールnginxの-V
./configure --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --modules-path=/usr/lib64/nginx/modules --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --http-client-body-temp-path=/var/cache/nginx/client_temp --http-proxy-temp-path=/var/cache/nginx/proxy_temp --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp --http-scgi-temp-path=/var/cache/nginx/scgi_temp --user=nginx --group=nginx --with-compat --with-file-aio --with-threads --with-http_addition_module --with-http_auth_request_module --with-http_dav_module --with-http_flv_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_mp4_module --with-http_random_index_module --with-http_realip_module --with-http_secure_link_module --with-http_slice_module --with-http_ssl_module --with-http_stub_status_module --with-http_sub_module --with-http_v2_module --with-mail --with-mail_ssl_module --with-stream --with-stream_realip_module --with-stream_ssl_module --with-stream_ssl_preread_module --with-cc-opt='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fPIC' --with-ld-opt='-Wl,-z,relro -Wl,-z,now -pie'
、コンパイラ依存モジュールが動的コンパイルインストールされていないときに--with-http_image_filter_module =有する内部上記のコマンドで起動モジュールに対応するエラーが単に設置することができるせます。
私は、コンパイル時の依存関係は、2つのモジュールがインストールされていませんしています。
./configure: error: the HTTP rewrite module requires the PCRE library.
You can either disable the module by using --without-http_rewrite_module
option, or install the PCRE library into the system, or build the PCRE library
statically from the source with nginx by using --with-pcre=<path> option.
安装PCRE-develの:YUM PCRE-develのインストール
./configure: error: the HTTP image filter module requires the GD library.
You can either do not enable the module or install the libraries.
インストールGD-develの:YUM GD-develのインストール
インストールされているものに欠けているものを一言で言えば、多くのオンラインの記事は、すべての依存モジュールを導入しています。
第三に、ソースパッケージをコンパイル
メイクを実行し、make installを実行する必要がない覚えて、ちょうどここnginxの再コンパイル、実行可能ファイルを取得する必要があり、元のnginxを置き換える再インストールする必要はありません。
実行が完了すると、ディレクトリのnginxのOBJSで対応する実行可能ファイルを生成します。
コピー画像フィルタリングモジュール:CP OBJS / ngx_http_image_filter_module.soの/ usr / lib64に/ nginxの/モジュール/
nginxの実行可能ファイルをカバーします。cp -rfp OBJS / nginxのは/ usr / sbinに/
四、nginxの設定ファイル
load_module "モジュール/ ngx_http_image_filter_module.so";:モジュールを動的にロードされた/etc/nginx/nginx.conf
/etc/nginx/conf.d/test.conf構成画像処理
location ~* /(.+)\.(jpg|jpeg|gif|png)!(\d+)x(\d+)$ {
set $w $3;
set $h $4;
image_filter resize $w $h;
image_filter_buffer 10M;
image_filter_jpeg_quality 75;
try_files /$1.$2 /notfound.jpg;
# expires 30d;
}
nginxの-tチェックnginxの設定構文がOKである、あなたはnginxのを再起動することができます
第五に、テスト画像ズーム
アートワークの訪問:
サムネイルのURLにアクセスしてください:
以下の2を参照してくださいには、十分なああです
https://blog.csdn.net/zzy5066/article/details/81136273
https://www.cnblogs.com/lixigang/articles/5130052.html
https://www.cnblogs.com/tinywan/p/6965467.html nginxの動的ロードモジュール