Question

I installed ngx_pagespeed 1.7.30.3 with nginx 1.4.4 on a debian 7.3 virtual server. The pagespeed module seems to be running, becouse it creates some files and folders in the cache directory. Also i get the pagespeed specific headers (X-Page-Speed:1.7.30.3-3721) if i do a GET on my site. The problem is that the pagespeed module only works for html files, resources like css, js and images doesn't have the specific header. In addiditon they are not optimized (minified, concat ... ). It seems the pagespeed module dont server the optimized files.

I dont know if this is important. One week ago all works fine, but i added a certificate to my site and only enabled https.

Here is my nginx config for the correspondening virtual host:

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

The line pagespeed RewriteLevel CoreFilters; should enable all core filters (https://developers.google.com/speed/pagespeed/module/config_filters). But they dont seem to work. They are no error messages in the nginx error.log. Any ideas on how to fix that?

Était-ce utile?

La solution

Check out the Domain, MapRewriteDomain, MapOriginDomain & LoadFromFile.

It works for me after I added them.

https://developers.google.com/speed/pagespeed/module/https_support

https://developers.google.com/speed/pagespeed/module/domains

You may also be interested in SPDY. - http://nginx.org/en/docs/http/ngx_http_spdy_module.html

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top