debian 7.3仮想サーバーにnginx 1.4.4とともにngx_pagespeed 1.7.30.3をインストールしました。pagespeed モジュールが実行されているようです。これは、キャッシュ ディレクトリにいくつかのファイルとフォルダーを作成するためです。また、自分のサイトで GET を実行すると、pagespeed 固有のヘッダー (X-Page-Speed:1.7.30.3-3721) を取得します。問題は、pagespeed モジュールが html ファイルに対してのみ機能し、css、js、画像などのリソースに特定のヘッダーがないことです。さらに、それらは最適化されていません(縮小、連結...)。pagespeed モジュールは最適化されたファイルを提供していないようです。
これが重要かどうかはわかりません。1 週間前はすべて正常に動作していましたが、サイトに証明書を追加し、https のみを有効にしました。
対応する仮想ホストのnginx構成は次のとおりです。
server {
listen 443 ssl;
server_name www.termin2go.com
ssl_certificate ***/www.termin2go.com.crt;
ssl_certificate_key ***/www.termin2go.com.key;
access_log /var/log/nginx/termin2go.com.log;
index index.html index.htm;
set $root_path '/var/www/termin2go.com';
root $root_path;
charset utf-8;
# page speed settings
pagespeed on;
pagespeed RewriteLevel CoreFilters;
pagespeed RespectVary on;
pagespeed FileCachePath /var/ngx_pagespeed_cache;
pagespeed RewriteLevel CoreFilters;
# Ensure requests for pagespeed optimized resources go to the pagespeed handler
# and no extraneous headers get set.
location ~ "\.pagespeed\.([a-z]\.)?[a-z]{2}\.[^.]{10}\.[^.]+" {
add_header "" "";
}
location ~ "^/ngx_pagespeed_static/" { }
location ~ "^/ngx_pagespeed_beacon$" { }
location /ngx_pagespeed_statistics { allow 127.0.0.1; deny all; }
location /ngx_pagespeed_global_statistics { allow 127.0.0.1; deny all; }
# cache static files 30 days
location ~* \.(css|cur|js|jpe?g|gif|htc|ico|png|html|xml|otf|ttf|eot|woff|svg)$ {
access_log off;
expires 30d;
tcp_nodelay off;
## Set the OS file cache.
open_file_cache max=3000 inactive=120s;
open_file_cache_valid 45s;
open_file_cache_min_uses 2;
open_file_cache_errors off;
}
}
この行pagespeed RewriteLevel CoreFilters;
は、すべてのコア フィルターを有効にする必要があります ( https://developers.google.com/speed/pagespeed/module/config_filters )。しかし、それらは機能していないようです。これらは、nginx error.log のエラー メッセージではありません。それを修正する方法についてのアイデアはありますか?