Tag Archives: nginx

Nginx Pagespeed 404 file not found

Проблема: На клиенте не корректно отображается страницы сайта. Смотрим в Network – видим 404 Not Found на js и css, которые обработал pagespeed c фильтром combine_*

Link: Vendor  

Альтернативное решение: перенаправление на локальные файлы. Думаю, что это не правильный выход из ситуации. И не сработает с фильтрами pagespeed c фильтрами combine. Но имеет право на жизнь.

Перенаправление по 404 на локальные файлы

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;
}

[collapse]

Пример переноса сайта на VPS

Старый сервер: физический сервер в дата-центре

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.

Continue reading

RoundCube failed attach upload

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"