Files
incubator-pagespeed-ngx/test/pagespeed_test.conf.template
T
Anupama Dutta 1fe6c54b94 Trunk tracking updates to sync to PSOl r3677.
Includes minor additions to test only.

Trunk tracking updates to sync to PSOl r3677.

Trunk tracking update to sync to PSOL r3677

Includes minor additions to test only.
2013-12-12 22:27:27 -05:00

961 lines
32 KiB
Plaintext

# nginx_system_test.sh makes a few substitutions to pagespeed_test.conf.template
# file to generate @@TEST_TMP@@/pagespeed_test.conf
# The cache flush test depends on worker_processes=1.
worker_processes 1;
daemon @@DAEMON@@;
master_process on;
error_log "@@ERROR_LOG@@" debug;
pid "@@TEST_TMP@@/nginx.pid";
events {
worker_connections 1024;
}
http {
server_names_hash_bucket_size 128;
log_format cache '$time_local '
'$upstream_cache_status '
'$http_host $request ($status) '
'"$http_user_agent"';
access_log "@@ACCESS_LOG@@" cache;
proxy_cache_path "@@PROXY_CACHE@@" levels=1:2 keys_zone=htmlcache:60m inactive=90m max_size=50m;
proxy_temp_path "@@TMP_PROXY_CACHE@@";
root "@@SERVER_ROOT@@";
pagespeed UsePerVHostStatistics on;
pagespeed InPlaceResourceOptimization on;
pagespeed CreateSharedMemoryMetadataCache "@@SHM_CACHE@@" 8192;
pagespeed PreserveUrlRelativity on;
# CriticalImagesBeaconEnabled is now on by default, but we disable in testing.
# With this option enabled, the inline image system test will currently fail.
# When critical image beaconing is enabled, only critical images are inlined.
# In our current system test, we aren't yet sending a beacon to identify the
# critical images to be inlined, so we just disable the option here.
pagespeed CriticalImagesBeaconEnabled false;
pagespeed Statistics on;
pagespeed StatisticsLogging on;
pagespeed LogDir "@@TEST_TMP@@/logdir";
server {
# Sets up a logical home-page server on
# max-cacheable-content-length.example.com. This server is only used to
# test ModPagespeedMaxCacheableContentLength, i.e.,
# max_cacheable_response_content_length.
listen @@SECONDARY_PORT@@;
server_name max-cacheable-content-length.example.com;
pagespeed FileCachePath "@@FILE_CACHE@@";
pagespeed BlockingRewriteKey psatest;
pagespeed RewriteLevel PassThrough;
pagespeed EnableFilters rewrite_javascript;
pagespeed MaxCacheableContentLength 85;
}
pagespeed UseNativeFetcher "@@NATIVE_FETCHER@@";
@@RESOLVER@@
server {
# This server represents the external caching layer server which
# receives user requests and proxies them to the upstream server
# running on the PRIMARY_PORT when the response is not available in
# the cache. It also services purge requests from the upstream server.
listen @@SECONDARY_PORT@@;
server_name proxy_cache.example.com;
pagespeed FileCachePath "@@FILE_CACHE@@";
pagespeed off;
set $ua_dependent_ps_capability_list "";
set $bypass_cache 1;
if ($http_user_agent ~* "Chrome/|Firefox/|MSIE |Safari|Wget") {
# User Agents that support lazyload-images (ll), inline-images (ii) and
# defer-javascript (dj).
set $ua_dependent_ps_capability_list "ll,ii,dj:";
set $bypass_cache 0;
}
if ($http_user_agent ~*
"Chrome/[2][3-9]+\.|Chrome/[[3-9][0-9]+\.|Chrome/[0-9]{3,}\.") {
# User Agents that support lazyload-images (ll), inline-images (ii),
# defer-javascript (dj), webp (jw) and webp-lossless (ws).
set $ua_dependent_ps_capability_list "ll,ii,dj,jw,ws:";
set $bypass_cache 0;
}
# All User Agents that represent
# 1) mobiles
# 2) tablets
# 3) desktop browsers that do not have defer-javascript capability at a minimum
# are made to go to the pagespeed server directly bypassing the proxy_cache.
if ($http_user_agent ~* "Firefox/[1-2]\.|MSIE [5-8]\.") {
set $ua_dependent_ps_capability_list "";
set $bypass_cache 1;
}
if ($http_user_agent ~* "Mozilla.*Android.*Mobile*|iPhone|BlackBerry|Opera Mobi|Opera Mini|SymbianOS|UP.Browser|J-PHONE|Profile/MIDP|portalmmm|DoCoMo|Obigo") {
# These are Mobile User Agents. We don't cache responses for these.
set $ua_dependent_ps_capability_list "";
set $bypass_cache 1;
}
if ($http_user_agent ~* "Android|iPad|TouchPad|Silk-Accelerated|Kindle Fire") {
# These are Tablet User Agents. We don't cache responses for these.
set $ua_dependent_ps_capability_list "";
set $bypass_cache 1;
}
location ~ /purge(/.*) {
allow all;
proxy_cache_purge htmlcache $ua_dependent_ps_capability_list$1$is_args$args;
}
location /mod_pagespeed_test/cachable_rewritten_html/ {
proxy_pass http://localhost:@@PRIMARY_PORT@@;
proxy_set_header Host $host;
proxy_cache_valid 200 30s;
proxy_cache htmlcache;
proxy_ignore_headers Cache-Control;
add_header X-Cache $upstream_cache_status;
proxy_cache_key $ua_dependent_ps_capability_list$uri$is_args$args;
proxy_cache_bypass $bypass_cache;
}
}
server {
listen @@SECONDARY_PORT@@;
server_name mpd.example.com;
pagespeed FileCachePath "@@SECONDARY_CACHE@@";
pagespeed MapProxyDomain mpd.example.com/gstatic_images
http://www.gstatic.com/psa/static;
}
# These two vhosts are for testing the experiment framework (Furious).
server {
listen @@SECONDARY_PORT@@;
server_name experiment.example.com;
pagespeed FileCachePath "@@FILE_CACHE@@";
pagespeed RunExperiment on;
pagespeed AnalyticsID "123-45-6734";
pagespeed ExperimentVariable 2;
pagespeed ExperimentSpec
"id=7;enable=recompress_images;disable=convert_jpeg_to_progressive;percent=50";
pagespeed ExperimentSpec "id=2;enable=recompress_images;percent=50";
}
server {
listen @@SECONDARY_PORT@@;
server_name experiment.noga.example.com;
pagespeed FileCachePath "@@FILE_CACHE@@";
pagespeed RunExperiment on;
pagespeed ExperimentVariable 2;
pagespeed ExperimentSpec
"id=7;enable=recompress_images;disable=convert_jpeg_to_progressive;percent=50";
pagespeed ExperimentSpec "id=2;enable=recompress_images;percent=50";
}
server {
listen @@SECONDARY_PORT@@;
server_name preserveurls.example.com;
pagespeed FileCachePath "@@FILE_CACHE@@";
pagespeed EnableFilters inline_preview_images,lazyload_images;
pagespeed EnableFilters resize_mobile_images,rewrite_images,sprite_images;
pagespeed EnableFilters fallback_rewrite_css_urls,flatten_css_imports;
pagespeed EnableFilters inline_css,move_css_above_scripts,move_css_to_head;
pagespeed EnableFilters outline_css,rewrite_css,combine_css;
pagespeed EnableFilters combine_javascript,defer_javascript;
pagespeed EnableFilters inline_javascript;
pagespeed EnableFilters outline_javascript,rewrite_javascript;
location /mod_pagespeed_test/preserveurls/on/ {
pagespeed JsPreserveURLs On;
pagespeed ImagePreserveURLs On;
pagespeed CssPreserveURLs On;
}
location /mod_pagespeed_test/preserveurls/off/ {
pagespeed JsPreserveURLs Off;
pagespeed ImagePreserveURLs Off;
pagespeed CssPreserveURLs Off;
}
}
server {
# Setup a vhost with the critical image beacon and lazyload filter enabled
# to make sure that critical images are not lazyloaded.
listen @@SECONDARY_PORT@@;
server_name imagebeacon.example.com;
pagespeed FileCachePath "@@FILE_CACHE@@";
pagespeed RewriteLevel PassThrough;
pagespeed EnableFilters lazyload_images;
pagespeed CriticalImagesBeaconEnabled true;
}
server {
# Setup a vhost with the critical image beacon and lazyload filter enabled
# to make sure that downstream caches and rebeaconing interact correctly.
listen @@SECONDARY_PORT@@;
server_name downstreamcacherebeacon.example.com;
pagespeed FileCachePath "@@FILE_CACHE@@";
pagespeed RewriteLevel PassThrough;
pagespeed EnableFilters lazyload_images;
pagespeed CriticalImagesBeaconEnabled true;
# Enable the downstream caching feature and specify a rebeaconing key.
pagespeed DownstreamCachePurgeLocationPrefix "http://localhost:@@SECONDARY_PORT@@/purge";
pagespeed DownstreamCacheRebeaconingKey random_rebeaconing_key;
}
server {
listen @@SECONDARY_PORT@@;
server_name renderedimagebeacon.example.com;
pagespeed FileCachePath "@@FILE_CACHE@@";
pagespeed RewriteLevel PassThrough;
pagespeed EnableFilters resize_rendered_image_dimensions;
pagespeed CriticalImagesBeaconEnabled true;
}
server {
# For testing with a custom origin header. In this VirtualHost,
# /mod_pagespeed_test is included in our DocumentRoot and thus does
# not need to be in any resource URL paths. This helps us verify that
# we are looping back to the corect VirtualHost -- if we hit the wrong
# one it will not work. Also we don't have a VirtualHost for
# sharedcdn.example.com, so the default Host header used for
# origin-mapping won't work either. Instead, we want origin-fetches
# to go back to this VirtualHost so we rely on the new third optional
# argument to MapOriginDomain.
listen @@SECONDARY_PORT@@;
server_name customhostheader.example.com;
pagespeed FileCachePath "@@FILE_CACHE@@_test";
root "@@SERVER_ROOT@@/mod_pagespeed_test";
pagespeed on;
pagespeed RewriteLevel PassThrough;
pagespeed EnableFilters rewrite_images;
pagespeed MapOriginDomain localhost:@@SECONDARY_PORT@@/bug781 sharedcdn.example.com/test customhostheader.example.com;
pagespeed JpegRecompressionQuality 50;
pagespeed CriticalImagesBeaconEnabled false;
}
server {
# Sets up a virtual host where we can specify forbidden filters without
# affecting any other hosts.
listen @@SECONDARY_PORT@@;
server_name forbidden.example.com;
pagespeed FileCachePath "@@FILE_CACHE@@";
pagespeed BlockingRewriteKey psatest;
# Start with all core filters enabled ...
pagespeed RewriteLevel CoreFilters;
# ... then forbid these filters ...
pagespeed ForbidFilters remove_quotes,remove_comments,collapse_whitespace;
pagespeed ForbidFilters rewrite_css,resize_images;
# ... and disable but not forbid this one (to ensure we retain its URL).
pagespeed DisableFilters inline_css;
}
server {
listen @@SECONDARY_PORT@@;
server_name client-domain-rewrite.example.com;
pagespeed FileCachePath "@@FILE_CACHE@@";
# Don't actually try to rewrite any resources; the ones in
# rewrite_domains.html don't actually exist.
pagespeed RewriteLevel PassThrough;
pagespeed MapRewriteDomain http://client-domain-rewrite.example.com
http://src.example.com;
pagespeed ClientDomainRewrite true;
pagespeed EnableFilters rewrite_domains;
}
server {
listen @@SECONDARY_PORT@@;
server_name url-attribute.example.com;
pagespeed FileCachePath "@@FILE_CACHE@@";
# Don't actually try to rewrite any resources; the ones in
# rewrite_domains.html don't actually exist.
pagespeed RewriteLevel PassThrough;
# This is used for testing dynamically defined url-valued
# attributes
pagespeed UrlValuedAttribute span src Hyperlink;
pagespeed UrlValuedAttribute hr imgsrc Image;
pagespeed DomainRewriteHyperlinks on;
pagespeed MapRewriteDomain http://dst.example.com http://src.example.com;
pagespeed EnableFilters rewrite_domains;
pagespeed UrlValuedAttribute custom a Image;
pagespeed UrlValuedAttribute custom b otherResource;
pagespeed UrlValuedAttribute custom c hyperlink;
pagespeed UrlValuedAttribute img alt-src Image;
pagespeed UrlValuedAttribute video alt-a Image;
pagespeed UrlValuedAttribute video alt-b Image;
}
server {
listen 127.0.0.2:@@SECONDARY_PORT@@;
server_name loopbackfetch.example.com;
pagespeed FileCachePath "@@FILE_CACHE@@";
}
server {
listen @@SECONDARY_PORT@@;
server_name domain-hyperlinks-on.example.com;
pagespeed FileCachePath "@@FILE_CACHE@@";
# Don't actually try to rewrite any resources; the ones in
# rewrite_domains.html don't actually exist.
pagespeed RewriteLevel PassThrough;
pagespeed DomainRewriteHyperlinks on;
pagespeed MapRewriteDomain http://dst.example.com http://src.example.com;
pagespeed EnableFilters rewrite_domains;
}
server {
listen @@SECONDARY_PORT@@;
server_name domain-hyperlinks-off.example.com;
pagespeed FileCachePath "@@FILE_CACHE@@";
# Don't actually try to rewrite any resources; the ones in
# rewrite_domains.html don't actually exist.
pagespeed RewriteLevel PassThrough;
pagespeed DomainRewriteHyperlinks off;
pagespeed MapRewriteDomain http://dst.example.com http://src.example.com;
pagespeed EnableFilters rewrite_domains;
}
server {
listen @@SECONDARY_PORT@@;
server_name retaincomment.example.com;
pagespeed FileCachePath "@@FILE_CACHE@@";
pagespeed RetainComment " google_ad_section*";
}
server {
# Test host for shared memory cache.
listen @@SECONDARY_PORT@@;
server_name shmcache.example.com;
pagespeed FileCachePath "@@SHM_CACHE@@";
pagespeed RewriteLevel PassThrough;
pagespeed EnableFilters rewrite_images;
}
server {
listen @@SECONDARY_PORT@@;
server_name xfp.example.com;
pagespeed FileCachePath "@@FILE_CACHE@@";
pagespeed RespectXForwardedProto on;
}
server {
listen @@SECONDARY_PORT@@;
server_name xheader.example.com;
pagespeed FileCachePath "@@FILE_CACHE@@";
pagespeed XHeaderValue "UNSPECIFIED VERSION";
}
# Support for embedded configurations, where image flags in the
# VirtualHost serving HTML is not the same as the one serving resources,
# and thus we must embed the image flags in the rewritten image URLs.
#
# Note that we test with two distinct caches.
server {
listen @@SECONDARY_PORT@@;
server_name embed-config-html.example.com;
pagespeed FileCachePath "@@FILE_CACHE@@";
root "@@SERVER_ROOT@@/mod_pagespeed_test";
pagespeed AddOptionsToUrls on;
pagespeed JpegRecompressionQuality 73;
pagespeed DisableFilters inline_css,extend_cache,inline_javascript;
pagespeed Domain embed-config-resources.example.com;
pagespeed LoadFromFile "http://embed-config-resources.example.com/"
"@@SERVER_ROOT@@/mod_pagespeed_example/";
}
server {
listen @@SECONDARY_PORT@@;
server_name embed-config-resources.example.com;
pagespeed FileCachePath "@@FILE_CACHE@@";
root "@@SERVER_ROOT@@/mod_pagespeed_example";
pagespeed AddOptionsToUrls on;
# Note that we do not set the jpeg quality here, but take
# it from image URL query parameters that we synthesize in
# from embed-config-html.example.com.
pagespeed LoadFromFile "http://embed-config-resources.example.com/"
"@@SERVER_ROOT@@/mod_pagespeed_example/";
}
server {
listen @@SECONDARY_PORT@@;
server_name respectvary.example.com;
pagespeed FileCachePath "@@FILE_CACHE@@";
pagespeed RespectVary on;
add_header Vary User-Agent;
}
server {
listen @@SECONDARY_PORT@@;
server_name cache_a.example.com;
pagespeed FileCachePath "@@FILE_CACHE@@";
pagespeed CacheFlushPollIntervalSec 1;
pagespeed RewriteLevel PassThrough;
pagespeed EnableFilters inline_css;
}
server {
listen @@SECONDARY_PORT@@;
server_name cache_b.example.com;
pagespeed FileCachePath "@@SECONDARY_CACHE@@";
pagespeed CacheFlushPollIntervalSec 1;
pagespeed RewriteLevel PassThrough;
pagespeed EnableFilters inline_css;
}
server {
listen @@SECONDARY_PORT@@;
server_name cache_c.example.com;
pagespeed FileCachePath "@@FILE_CACHE@@";
pagespeed CacheFlushFilename "othercache.flush";
pagespeed CacheFlushPollIntervalSec 1;
pagespeed RewriteLevel PassThrough;
pagespeed EnableFilters inline_css;
}
# The next three server blocks are for a cdn test.
server {
# Sets up a logical home-page server on www.example.com
listen @@SECONDARY_PORT@@;
server_name www.example.com;
pagespeed FileCachePath "@@FILE_CACHE@@";
pagespeed LoadFromFile http://cdn.example.com @@SERVER_ROOT@@;
pagespeed MapRewriteDomain cdn.example.com origin.example.com;
pagespeed RewriteLevel PassThrough;
pagespeed EnableFilters rewrite_css,rewrite_images;
}
server {
# Sets up a logical origin for CDNs to fetch content from, on
# origin.example.com.
listen @@SECONDARY_PORT@@;
server_name origin.example.com;
pagespeed FileCachePath "@@FILE_CACHE@@";
pagespeed LoadFromFile http://cdn.example.com @@SERVER_ROOT@@;
pagespeed MapRewriteDomain cdn.example.com origin.example.com;
pagespeed RewriteLevel PassThrough;
pagespeed EnableFilters rewrite_css,rewrite_images;
}
server {
# Sets up a logical cdn, which is where we tell browsers to fetch resources
# from.
listen @@SECONDARY_PORT@@;
server_name cdn.example.com;
pagespeed FileCachePath "@@FILE_CACHE@@";
pagespeed LoadFromFile http://cdn.example.com @@SERVER_ROOT@@;
pagespeed MapRewriteDomain cdn.example.com origin.example.com;
pagespeed RewriteLevel PassThrough;
pagespeed EnableFilters rewrite_css,rewrite_images;
}
server {
listen @@SECONDARY_PORT@@;
server_name tryfiles.example.com;
pagespeed FileCachePath "@@FILE_CACHE@@";
location ~ "\.pagespeed\.([a-z]\.)?[a-z]{2}\.[^.]{10}\.[^.]+" { }
location ~ "^/ngx_pagespeed_static/" { }
location ~ "^/ngx_pagespeed_beacon$" { }
try_files $uri $uri/ /mod_pagespeed_example/index.html;
}
server {
# Proxy modpagespeed.com for testing Issue 582.
listen @@SECONDARY_PORT@@;
server_name modpagespeed.com;
pagespeed FileCachePath "@@FILE_CACHE@@";
pagespeed off;
location / {
proxy_pass http://modpagespeed.com;
}
}
server {
listen @@SECONDARY_PORT@@;
server_name notransform.example.com;
pagespeed FileCachePath "@@FILE_CACHE@@";
pagespeed RewriteLevel PassThrough;
pagespeed EnableFilters rewrite_images;
add_header Cache-Control no-transform;
}
server {
listen @@SECONDARY_PORT@@;
server_name blocking.example.com;
pagespeed FileCachePath "@@SECONDARY_CACHE@@";
pagespeed BlockingRewriteKey psatest;
pagespeed RewriteLevel PassThrough;
pagespeed EnableFilters rewrite_images;
}
server {
listen @@SECONDARY_PORT@@;
server_name keepalive-html.example.com;
pagespeed FileCachePath "@@FILE_CACHE@@";
pagespeed RewriteLevel CoreFilters;
error_log "@@TEST_TMP@@/keepalive-html.example.com.error.log" warn;
}
server {
listen @@SECONDARY_PORT@@;
server_name keepalive-resource.example.com;
pagespeed FileCachePath "@@FILE_CACHE@@";
error_log "@@TEST_TMP@@/keepalive-resource.example.com.error.log" warn;
}
server {
listen @@SECONDARY_PORT@@;
server_name keepalive-beacon-get.example.com;
pagespeed FileCachePath "@@FILE_CACHE@@";
error_log "@@TEST_TMP@@/keepalive-beacon-get.example.com.error.log" warn;
}
server {
listen @@SECONDARY_PORT@@;
server_name keepalive-beacon-post.example.com;
pagespeed FileCachePath "@@FILE_CACHE@@";
error_log "@@TEST_TMP@@/keepalive-beacon-post.example.com.error.log" warn;
}
server {
listen @@SECONDARY_PORT@@;
server_name keepalive-static.example.com;
pagespeed FileCachePath "@@FILE_CACHE@@";
error_log "@@TEST_TMP@@/keepalive-static.example.com.error.log" warn;
}
server {
listen @@SECONDARY_PORT@@;
server_name response-header-filters.example.com;
pagespeed FileCachePath "@@SECONDARY_CACHE@@";
pagespeed RewriteLevel PassThrough;
pagespeed on;
add_header PageSpeedFilters add_instrumentation;
}
server {
listen @@SECONDARY_PORT@@;
server_name response-header-disable.example.com;
pagespeed FileCachePath "@@SECONDARY_CACHE@@";
pagespeed EnableFilters add_instrumentation;
pagespeed on;
add_header PageSpeed off;
}
server {
listen @@SECONDARY_PORT@@;
server_name ipro.example.com;
pagespeed FileCachePath "@@SECONDARY_CACHE@@";
pagespeed on;
pagespeed InPlaceResourceOptimization on;
location /mod_pagespeed_test/ipro/nocache/test_image_dont_reuse.png {
add_header Cache-Control no-cache;
}
}
# Test hosts to cover all possible cache configurations. L1 will be filecache
# or memcache depending on the setting of MEMCACHED_TEST. These four hosts
# are for the four settings for the L2 cache.
# 1. L2_d=LRU, L2_m=LRU
server {
listen @@SECONDARY_PORT@@;
server_name lrud-lrum.example.com;
pagespeed FileCachePath "@@SECONDARY_CACHE@@_lrud_lrum";
pagespeed LRUCacheKbPerProcess 1024;
pagespeed LRUCacheByteLimit 2000;
pagespeed EnableFilters rewrite_images;
pagespeed CriticalImagesBeaconEnabled false;
}
# 2. L2_d=LRU, L2_m=SHM
pagespeed CreateSharedMemoryMetadataCache
"@@SECONDARY_CACHE@@_lrud_shmm" 8192;
server {
listen @@SECONDARY_PORT@@;
server_name lrud-shmm.example.com;
pagespeed FileCachePath "@@SECONDARY_CACHE@@_lrud_shmm";
pagespeed LRUCacheKbPerProcess 1024;
pagespeed LRUCacheByteLimit 2000;
pagespeed EnableFilters rewrite_images;
pagespeed CriticalImagesBeaconEnabled false;
}
# 3. L2_d=none, L2_m=SHM
pagespeed CreateSharedMemoryMetadataCache
"@@SECONDARY_CACHE@@_noned_shmm" 8192;
server {
listen @@SECONDARY_PORT@@;
server_name noned-shmm.example.com;
pagespeed FileCachePath "@@SECONDARY_CACHE@@_noned_shmm";
pagespeed EnableFilters rewrite_images;
pagespeed CriticalImagesBeaconEnabled false;
}
# 4. L2_d=none, L2_m=none
server {
listen @@SECONDARY_PORT@@;
server_name noned-nonem.example.com;
pagespeed FileCachePath "@@SECONDARY_CACHE@@_noned_nonem";
pagespeed EnableFilters rewrite_images;
pagespeed CriticalImagesBeaconEnabled false;
}
server {
listen @@PRIMARY_PORT@@;
server_name localhost;
pagespeed FileCachePath "@@FILE_CACHE@@";
location ~ "\.pagespeed\.([a-z]\.)?[a-z]{2}\.[^.]{10}\.[^.]+" {
add_header "" "";
}
location /mod_pagespeed_test/cachable_rewritten_html/ {
# This location has the html files that will be configured to be stored
# in the proxy_cache layer.
pagespeed DownstreamCachePurgeMethod "GET";
pagespeed DownstreamCachePurgeLocationPrefix "http://localhost:@@SECONDARY_PORT@@/purge";
# We use a very small deadline here to force the rewriting to not complete
# in the very first attempt.
pagespeed RewriteDeadlinePerFlushMs 1;
pagespeed RewriteLevel PassThrough;
pagespeed EnableFilters collapse_whitespace,extend_cache,recompress_images,convert_jpeg_to_webp,defer_javascript;
}
location /mod_pagespeed_test/disable_no_transform/index.html {
pagespeed DisableRewriteOnNoTransform off;
}
location /mod_pagespeed_test/disable_no_transform/disable_no_transform.css {
add_header 'Cache-Control' 'no-transform';
}
# uncomment the following two lines if you're testing memcached
#pagespeed MemcachedServers "localhost:11211";
#pagespeed MemcachedThreads 1;
pagespeed on;
pagespeed MessageBufferSize 200000;
#pagespeed CacheFlushPollIntervalSec 1;
#pagespeed RunExperiment on;
#pagespeed AnalyticsID "UA-XXXXXXXX-Y";
#pagespeed ExperimentSpec "id=1;percent=50;default";
#pagespeed ExperimentSpec "id=2;percent=50";
pagespeed Library 43 1o978_K0_LNE5_ystNklf
http://www.modpagespeed.com/rewrite_javascript.js;
# If X-PSA-Blocking-Rewrite request header is present and its value matches
# the value of BlockingRewriteKey below, the response will be fully
# rewritten before being flushed to the client.
pagespeed BlockingRewriteKey psatest;
add_header X-Extra-Header 1;
# Establish a proxy mapping where the current server proxies an image
# stored on ref.pssdemos.com.
pagespeed MapProxyDomain localhost:@@PRIMARY_PORT@@/gstatic_images
http://www.gstatic.com/psa/static;
location /ngx_pagespeed_statistics {
allow 127.0.0.1;
deny all;
}
location /ngx_pagespeed_message {
allow 127.0.0.1;
deny all;
}
pagespeed Domain modpagespeed.com:1023;
# As opposed to mod_pagespeed, our default for aris is 'on'
pagespeed AvoidRenamingIntrospectiveJavascript off;
location /mod_pagespeed_test/nostore {
add_header "Cache-Control" "max-age=12345";
add_header "Cache-Control" "public, no-store";
add_header "Cache-Control" "max-age=14";
}
location /mod_pagespeed_test/forbid_all_disabled/disabled {
# Prevent the enabling of these filters for files in this directory
# -and- all subdirectories.
#
# Apache checks here that they can't be renabled with .htaccess, but
# that's not how Nginx location blocks work.
pagespeed ForbidAllDisabledFilters true;
pagespeed DisableFilters remove_quotes,remove_comments;
pagespeed DisableFilters collapse_whitespace;
}
location /mod_pagespeed_test/max_html_parse_size {
pagespeed MaxHtmlParseBytes 5000;
}
location ~ \.php$ {
fastcgi_param SCRIPT_FILENAME $request_filename;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_pass 127.0.0.1:9000;
}
location /mod_pagespeed_example/core_filters/ {
pagespeed RewriteLevel CoreFilters;
}
location /mod_pagespeed_example/pass_through/ {
pagespeed RewriteLevel PassThrough;
}
#location / {
# proxy_pass http://www.google.com;
#}
location /mod_pagespeed_test/ssi/ {
ssi on;
pagespeed EnableFilters collapse_whitespace,remove_comments,combine_css;
pagespeed DisableFilters add_instrumentation;
pagespeed DisableFilters inline_css;
}
location /mod_pagespeed_test/no_cache/ {
add_header Cache-Control no-cache;
}
location /mod_pagespeed_test/compressed/ {
add_header Content-Encoding gzip;
# Even though this is also in the server block it must be repeated here
# because add_header directives are only inherited if you don't define
# more of them. See: http://serverfault.com/questions/400197
add_header X-Extra-Header 1;
types {
text/javascript custom_ext;
}
}
location /mod_pagespeed_test/shard/ {
pagespeed ShardDomain "localhost:@@PRIMARY_PORT@@" shard1,shard2;
pagespeed RewriteLevel PassThrough;
pagespeed EnableFilters extend_cache;
}
location /mod_pagespeed_test/retain_cache_control/ {
pagespeed ModifyCachingHeaders off;
add_header Cache-Control "private, max-age=3000";
}
location /mod_pagespeed_test/retain_cache_control_with_downstream_caching/ {
pagespeed ModifyCachingHeaders on;
pagespeed DownstreamCachePurgeLocationPrefix "http://localhost:8020/";
add_header Cache-Control "private, max-age=3000";
}
location /mod_pagespeed_test/avoid_renaming_introspective_javascript__on/ {
pagespeed AvoidRenamingIntrospectiveJavascript on;
}
location /mod_pagespeed_test/custom_options/ {
pagespeed DisableFilters convert_jpeg_to_progressive;
}
location /mod_pagespeed_test/ipro/test_image_dont_reuse.png {
expires 5m;
}
pagespeed EnableFilters remove_comments;
# Test LoadFromFile mapping by mapping one dir to another.
pagespeed LoadFromFile
"http://localhost:@@PRIMARY_PORT@@/mod_pagespeed_test/load_from_file/web_dir/"
"@@SERVER_ROOT@@/mod_pagespeed_test/load_from_file/file_dir/";
pagespeed LoadFromFileMatch
"^http://localhost:@@PRIMARY_PORT@@/mod_pagespeed_test/load_from_file_match/web_([^/]*)/"
"@@SERVER_ROOT@@/mod_pagespeed_test/load_from_file/file_\1/";
pagespeed LoadFromFileRule Disallow
"@@SERVER_ROOT@@/mod_pagespeed_test/load_from_file/file_dir/httponly/";
pagespeed LoadFromFileRuleMatch Disallow \.ssp.css$;
pagespeed LoadFromFileRuleMatch Allow exception\.ssp\.css$;
#charset koi8-r;
#access_log logs/host.access.log main;
index index.html;
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
sendfile on;
keepalive_timeout 65;
# set up gzip
gzip on;
gzip_vary on;
# Turn on gzip for all content types that should benefit from it.
gzip_types application/ecmascript;
gzip_types application/javascript;
gzip_types application/json;
gzip_types application/pdf;
gzip_types application/postscript;
gzip_types application/x-javascript;
gzip_types image/svg+xml;
gzip_types text/css;
gzip_types text/csv;
# "gzip_types text/html" is assumed.
gzip_types text/javascript;
gzip_types text/plain;
gzip_types text/xml;
gzip_http_version 1.0;
types {
text/html html htm shtml;
text/css css;
text/xml xml;
image/gif gif;
image/jpeg jpeg jpg;
application/x-javascript js;
application/atom+xml atom;
application/rss+xml rss;
text/mathml mml;
text/plain txt;
text/vnd.sun.j2me.app-descriptor jad;
text/vnd.wap.wml wml;
text/x-component htc;
image/png png;
image/tiff tif tiff;
image/vnd.wap.wbmp wbmp;
image/x-icon ico;
image/x-jng jng;
image/x-ms-bmp bmp;
image/svg+xml svg svgz;
image/webp webp;
application/java-archive jar war ear;
application/mac-binhex40 hqx;
application/msword doc;
application/pdf pdf;
application/postscript ps eps ai;
application/rtf rtf;
application/vnd.ms-excel xls;
application/vnd.ms-powerpoint ppt;
application/vnd.wap.wmlc wmlc;
application/vnd.google-earth.kml+xml kml;
application/vnd.google-earth.kmz kmz;
application/x-7z-compressed 7z;
application/x-cocoa cco;
application/x-java-archive-diff jardiff;
application/x-java-jnlp-file jnlp;
application/x-makeself run;
application/x-perl pl pm;
application/x-pilot prc pdb;
application/x-rar-compressed rar;
application/x-redhat-package-manager rpm;
application/x-sea sea;
application/x-shockwave-flash swf;
application/x-stuffit sit;
application/x-tcl tcl tk;
application/x-x509-ca-cert der pem crt;
application/x-xpinstall xpi;
application/xhtml+xml xhtml;
application/zip zip;
application/octet-stream bin exe dll;
application/octet-stream deb;
application/octet-stream dmg;
application/octet-stream eot;
application/octet-stream iso img;
application/octet-stream msi msp msm;
audio/midi mid midi kar;
audio/mpeg mp3;
audio/ogg ogg;
audio/x-m4a m4a;
audio/x-realaudio ra;
video/3gpp 3gpp 3gp;
video/mp4 mp4;
video/mpeg mpeg mpg;
video/quicktime mov;
video/webm webm;
video/x-flv flv;
video/x-m4v m4v;
video/x-mng mng;
video/x-ms-asf asx asf;
video/x-ms-wmv wmv;
video/x-msvideo avi;
}
default_type application/octet-stream;
}