Skip to content

Instantly share code, notes, and snippets.

@annez
Created March 20, 2015 09:29
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save annez/ded1d21999b790612dce to your computer and use it in GitHub Desktop.
Save annez/ded1d21999b790612dce to your computer and use it in GitHub Desktop.
Nginx pagespeed configuration
pagespeed on;
# Needs to exist and be writable by nginx. Use tmpfs for best performance.
pagespeed FileCachePath /var/ngx_pagespeed_cache;
pagespeed EnableFilters combine_css,extend_cache,rewrite_images,lazyload_images,collapse_whitespace,inline_javascript,inline_css,local_storage_cache,prioritize_critical_css;
pagespeed EnableFilters rewrite_css,rewrite_javascript;
# 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 ~ "^/pagespeed_static/" { }
location ~ "^/ngx_pagespeed_beacon$" { }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment