forked from combro2k/nginx-proxy-pagespeed
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathpagespeed.conf
30 lines (24 loc) · 1.09 KB
/
pagespeed.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# Enable pagespeed
pagespeed on;
# Needs to exist and be writable by nginx.
pagespeed FileCachePath /var/ngx_pagespeed_cache;
# 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; }
location /ngx_pagespeed_message { allow 127.0.0.1; deny all; }
# The filters we'll use
pagespeed RewriteLevel CoreFilters;
pagespeed EnableFilters rewrite_domains,trim_urls,sprite_images,prioritize_critical_css,lazyload_images,defer_javascript;
#The filters we don't want
pagespeed ForbidFilters convert_jpeg_to_webp;
# TODO Get rid of the port (caused by docker config)
#pagespeed MapProxyDomain localhost:59080/path www.sample.com/path;
# Force caching to get the css into pagespeed cache
#pagespeed ForceCaching on;
include /data/config/pagespeed-extra.conf;