Basic manual https://github.com/leev/ngx_http_geoip2_module
./configure --add-dynamic-module=../ngx_http_geoip2_module-3.4/ --with-compat --with-stream make modules make make install
Basic manual https://github.com/leev/ngx_http_geoip2_module
./configure --add-dynamic-module=../ngx_http_geoip2_module-3.4/ --with-compat --with-stream make modules make make install
Проблема: На клиенте не корректно отображается страницы сайта. Смотрим в Network – видим 404 Not Found на js и css, которые обработал pagespeed c фильтром combine_*
Link: Vendor
Альтернативное решение: перенаправление на локальные файлы. Думаю, что это не правильный выход из ситуации. И не сработает с фильтрами pagespeed c фильтрами combine. Но имеет право на жизнь.
Link: Original
## Pagespeed optimized resources that returns 404, redirect to original resource location ~ (.+)/x(.+),(.+)\.pagespeed\.[\.\-_[:alnum:]]+$ { # Handle resources with query string and Pagespeed optimized resources with # file name prefixed with x (eg. xMyImage.png,qitok=qwer.pagespeed.asdf.webp) error_page 404 = @orig_resource; set $orig_resource_uri $1/$2?$3; try_files $uri $uri/ $orig_resource_uri; } location ~ (.+),(.+)\.pagespeed\.[\.\-_[:alnum:]]+$ { # Handle resources with query string error_page 404 = @orig_resource; set $orig_resource_uri $1?$2; try_files $uri $uri/ $orig_resource_uri; } location ~ (.+)/x(.+)\.pagespeed\.[\.\-_[:alnum:]]+$ { # Handle Pagespeed optimized resources with file name prefixed with x # (eg. xMyImage.png.pagespeed.asdf.webp) error_page 404 = @orig_resource; set $orig_resource_uri $1/$2; try_files $uri $uri/ $orig_resource_uri; } location ~ (.+)\.pagespeed\.[\.\-_[:alnum:]]+$ { # Default handler error_page 404 = @orig_resource; set $orig_resource_uri $1; try_files $uri $uri/ $orig_resource_uri; } ## Redirect Pagespeed optimized resources that returns 404 to ## original resource. location @orig_resource { return 302 $scheme://$server_name$orig_resource_uri; }
MB: MSI H67MA-E45 (MS-7678)
CPU: Intel Core i5-2400 CPU @ 3.10GHz
RAM: 8 GB 4x2GB DBLT2GN568S
HDD: WDC WD10EZEX-00ZF5A0
Ubuntu 12.04.5
nginx version: nginx/1.1.19 (fronted)
Apache/2.2.22 (backend)
MySQL 5.5.54
PHP 5.3.10e
Показатель Pagespeed Insights – 32/100.
# ставим
$ gem install thin
# проверяем
$ thin -v
thin 1.7.0 codename Dunder Mifflin
Практический пример решения задачи оптимизации WЕВ-сервиса, который по словам пользователя “падает и тормозит”.
Прикладная система: Melbis Shop 6.1.1
Continue reading
2016/07/15 17:43:30 [error] 22154#22154: *2207 client intended to send too large body: 10000382 bytes, client: XX.XX.XX.XX, server: mail.domain.com, request: "POST /?_task=mail&_id=1420622575f0f14670b870&_uploadid=1594824233424&_from=compose&_action=upload HTTP/2.0", host: "mail.domain.com, referrer: "https://mail.domain.com/?_task=mail&_action=compose&_id=1420622575f0f14670b870"
Install
https://www.nginx.com/resources/wiki/start/topics/tutorials/install/
Debian /etc/apt/sources.list
# replace $release deb http://nginx.org/packages/debian/ $release nginx deb-src http://nginx.org/packages/debian/ $release nginx