2244 lines
78 KiB
Plaintext
2244 lines
78 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;
|
|
|
|
# Don't put entries in the error log for 403s and 404s.
|
|
log_not_found off;
|
|
|
|
proxy_cache_path "@@PROXY_CACHE@@" levels=1:2 keys_zone=htmlcache:60m inactive=90m max_size=50m;
|
|
proxy_temp_path "@@TMP_PROXY_CACHE@@";
|
|
|
|
pagespeed ProcessScriptVariables all;
|
|
pagespeed StatisticsPath /ngx_pagespeed_statistics;
|
|
pagespeed GlobalStatisticsPath /ngx_pagespeed_global_statistics;
|
|
pagespeed ConsolePath /pagespeed_console;
|
|
pagespeed MessagesPath /ngx_pagespeed_message;
|
|
pagespeed AdminPath /pagespeed_admin;
|
|
pagespeed GlobalAdminPath /pagespeed_global_admin;
|
|
|
|
pagespeed StaticAssetPrefix /pagespeed_custom_static/;
|
|
|
|
pagespeed MessageBufferSize 200000;
|
|
# Increase the default fetcher timeout to resolve sporadic flakeyness when
|
|
# the native fetcher uses 8.8.8.8 to resolve.
|
|
pagespeed FetcherTimeoutMs 10000;
|
|
pagespeed NativeFetcherMaxKeepaliveRequests 50;
|
|
|
|
root "@@SERVER_ROOT@@";
|
|
|
|
# Block 5a: Decide on Cache-Control header value to use for outgoing
|
|
# response.
|
|
# Map new_cache_control_header_val to "no-cache, max-age=0" if the
|
|
# content is html and use the original Cache-Control header value
|
|
# in all other cases.
|
|
map $upstream_http_content_type $new_cache_control_header_val {
|
|
default $upstream_http_cache_control;
|
|
"~*text/html" "no-cache, max-age=0";
|
|
}
|
|
|
|
pagespeed UsePerVHostStatistics on;
|
|
pagespeed InPlaceResourceOptimization on;
|
|
pagespeed CreateSharedMemoryMetadataCache "@@SHM_CACHE@@" 8192;
|
|
pagespeed BlockingRewriteKey psatest;
|
|
|
|
# We need to checkpoint more frequently than usual so that our checkpointing
|
|
# test will definitly have seen one of these intervals and so not be flaky.
|
|
# This needs to have a 1s interval because the checkpointing test has a 2s
|
|
# sleep.
|
|
pagespeed ShmMetadataCacheCheckpointIntervalSec 1;
|
|
|
|
# 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;
|
|
|
|
# By default, resources will not be used for inlining without explicit
|
|
# authorization. Supported values are off or a comma-separated list of strings
|
|
# from {Script,Stylesheet}.
|
|
pagespeed InlineResourcesWithoutExplicitAuthorization off;
|
|
|
|
pagespeed Statistics on;
|
|
pagespeed StatisticsLogging on;
|
|
pagespeed LogDir "@@TEST_TMP@@/logdir";
|
|
|
|
# Expanded to CentralControllerPort directive when RUN_CONTROLLER_TEST=on
|
|
@@CONTROLLER@@
|
|
|
|
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@@;
|
|
listen [::]:@@SECONDARY_PORT@@;
|
|
server_name max-cacheable-content-length.example.com;
|
|
pagespeed FileCachePath "@@FILE_CACHE@@";
|
|
|
|
|
|
pagespeed RewriteLevel PassThrough;
|
|
pagespeed EnableFilters rewrite_javascript;
|
|
pagespeed MaxCacheableContentLength 85;
|
|
}
|
|
|
|
# Test how load from file handles maximum sizes.
|
|
server {
|
|
listen @@SECONDARY_PORT@@;
|
|
listen [::]:@@SECONDARY_PORT@@;
|
|
server_name lff-large-files.example.com;
|
|
pagespeed FileCachePath "@@FILE_CACHE@@";
|
|
pagespeed RewriteLevel PassThrough;
|
|
pagespeed MaxCacheableContentLength 4096;
|
|
pagespeed LoadFromFile
|
|
"http://lff-large-files.example.com/"
|
|
"@@SERVER_ROOT@@/";
|
|
}
|
|
|
|
server {
|
|
listen @@SECONDARY_PORT@@;
|
|
listen [::]:@@SECONDARY_PORT@@;
|
|
server_name lff-large-files-no-fallback.example.com;
|
|
pagespeed FileCachePath "@@FILE_CACHE@@";
|
|
pagespeed RewriteLevel PassThrough;
|
|
pagespeed MaxCacheableContentLength 4096;
|
|
# http://lff-large-files-no-fallback.example.com/foo.css won't load, because
|
|
# we've configured a LoadFromFile pattern that doesn't match the path the
|
|
# webserver would take.
|
|
pagespeed LoadFromFile
|
|
"http://lff-large-files-no-fallback.example.com/"
|
|
"@@SERVER_ROOT@@/mod_pagespeed_example/styles/";
|
|
}
|
|
|
|
pagespeed UseNativeFetcher "@@NATIVE_FETCHER@@";
|
|
@@RESOLVER@@
|
|
|
|
server {
|
|
# Block 1: Basic port, server_name definitions.
|
|
# 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@@;
|
|
listen [::]:@@SECONDARY_PORT@@;
|
|
server_name proxy_cache.example.com;
|
|
pagespeed FileCachePath "@@FILE_CACHE@@";
|
|
|
|
# Disable PageSpeed on this server.
|
|
pagespeed off;
|
|
|
|
# Block 2: Define prefix for proxy_cache_key based on the UserAgent.
|
|
|
|
# Define placeholder PS-CapabilityList header values for large and small
|
|
# screens with no UA dependent optimizations. Note that these placeholder
|
|
# values should not contain any of ll, ii, dj, jw or ws, since these
|
|
# codes will end up representing optimizations to be supported for the
|
|
# request.
|
|
set $default_ps_capability_list_for_large_screens "LargeScreen.SkipUADependentOptimizations";
|
|
set $default_ps_capability_list_for_small_screens "TinyScreen.SkipUADependentOptimizations";
|
|
|
|
# As a fallback, the PS-CapabilityList header that is sent to the upstream
|
|
# PageSpeed server should be for a large screen device with no browser
|
|
# specific optimizations.
|
|
set $ps_capability_list $default_ps_capability_list_for_large_screens;
|
|
|
|
# Cache-fragment 1: Desktop User-Agents that support lazyload_images (ll),
|
|
# inline_images (ii) and defer_javascript (dj).
|
|
# Note: Wget is added for testing purposes only.
|
|
if ($http_user_agent ~* "Chrome/|Firefox/|MSIE |Safari|Wget") {
|
|
set $ps_capability_list "ll,ii,dj:";
|
|
}
|
|
# Cache-fragment 2: Desktop User-Agents that support lazyload_images (ll),
|
|
# inline_images (ii), defer_javascript (dj), webp (jw) and lossless_webp
|
|
# (ws).
|
|
if ($http_user_agent ~*
|
|
"Chrome/[2][3-9]+\.|Chrome/[3-9][0-9]+\.|Chrome/[0-9]{3,}\.") {
|
|
set $ps_capability_list "ll,ii,dj,jw,ws:";
|
|
}
|
|
# Cache-fragment 3: This fragment contains (a) Desktop User-Agents that
|
|
# match fragments 1 or 2 but should not because they represent older
|
|
# versions of certain browsers or bots and (b) Tablet User-Agents that
|
|
# correspond to large screens. These will only get optimizations that work
|
|
# on all browsers and use image compression qualities applicable to large
|
|
# screens. Note that even Tablets that are capable of supporting inline or
|
|
# webp images, e.g. Android 4.1.2, will not get these advanced
|
|
# optimizations.
|
|
if ($http_user_agent ~* "Firefox/[1-2]\.|MSIE [5-8]\.|bot|Yahoo!|Ruby|RPT-HTTPClient|(Google \(\+https\:\/\/developers\.google\.com\/\+\/web\/snippet\/\))|Android|iPad|TouchPad|Silk-Accelerated|Kindle Fire") {
|
|
set $ps_capability_list $default_ps_capability_list_for_large_screens;
|
|
}
|
|
# Cache-fragment 4: Mobiles and small screen Tablets will use image compression
|
|
# qualities applicable to small screens, but all other optimizations will be
|
|
# those that work on all browsers.
|
|
if ($http_user_agent ~* "Mozilla.*Android.*Mobile*|iPhone|BlackBerry|Opera Mobi|Opera Mini|SymbianOS|UP.Browser|J-PHONE|Profile/MIDP|portalmmm|DoCoMo|Obigo|Galaxy Nexus|GT-I9300|GT-N7100|HTC One|Nexus [4|7|S]|Xoom|XT907") {
|
|
set $ps_capability_list $default_ps_capability_list_for_small_screens;
|
|
}
|
|
|
|
# Block 3a: Bypass the cache for .pagespeed. resource. PageSpeed has its own
|
|
# cache for these, and these could bloat up the caching layer.
|
|
if ($uri ~ "\.pagespeed\.([a-z]\.)?[a-z]{2}\.[^.]{10}\.[^.]+") {
|
|
set $bypass_cache "1";
|
|
}
|
|
|
|
# For testing purposes, we never generate values that will result in a beacon
|
|
# unless a test request it via "X-Allow-Beacon: yes" in its request header.
|
|
# This is for testing purposes, note that in a production environment,
|
|
# you want 'set_random $rand 0 100;' unconditionally!
|
|
set $rand 5;
|
|
|
|
if ($http_x_allow_beacon ~ "yes") {
|
|
set_random $rand 0 100;
|
|
}
|
|
set $should_beacon_header_val "";
|
|
if ($rand ~* "^[0-4]$") {
|
|
set $should_beacon_header_val "random_rebeaconing_key";
|
|
set $bypass_cache 1;
|
|
}
|
|
|
|
# Block 3b: Only cache responses to clients that support gzip. Most clients
|
|
# do, and the cache holds much more if it stores gzipped responses.
|
|
if ($http_accept_encoding !~* gzip) {
|
|
set $bypass_cache "1";
|
|
}
|
|
|
|
# Block 4: Location block for purge requests.
|
|
location ~ /purge(/.*) {
|
|
allow 127.0.0.1;
|
|
allow ::1;
|
|
deny all;
|
|
proxy_cache_purge htmlcache $ps_capability_list$1$is_args$args;
|
|
}
|
|
|
|
# Block 6: Location block with proxy_cache directives.
|
|
location /mod_pagespeed_test/cachable_rewritten_html/ {
|
|
# 1: Upstream PageSpeed server is running at localhost:@@PRIMARY_PORT@@.
|
|
proxy_pass http://localhost:@@PRIMARY_PORT@@;
|
|
# 2: Use htmlcache as the zone for caching.
|
|
proxy_cache htmlcache;
|
|
# 3: Bypass requests that correspond to .pagespeed. resources
|
|
# or clients that do not support gzip etc.
|
|
proxy_cache_bypass $bypass_cache;
|
|
# 4: Use the redefined proxy_cache_key and make sure the /purge/
|
|
# block uses the same key.
|
|
proxy_cache_key $ps_capability_list$uri$is_args$args;
|
|
# 5: Forward Host header to upstream server.
|
|
proxy_set_header Host $host;
|
|
# 6: Set the PS-CapabilityList header for PageSpeed server to respect.
|
|
proxy_set_header PS-CapabilityList $ps_capability_list;
|
|
add_header PS-CapabilityList $ps_capability_list;
|
|
# 7: Add a header for identifying cache hits/misses/expires. This is
|
|
# for debugging purposes only and can be commented out in production.
|
|
add_header X-Cache $upstream_cache_status;
|
|
|
|
# Block 5b: Override Cache-Control headers as needed.
|
|
# Hide the upstream cache control header.
|
|
proxy_hide_header Cache-Control;
|
|
# Add the inferred Cache-Control header.
|
|
add_header Cache-Control $new_cache_control_header_val;
|
|
|
|
proxy_set_header PS-ShouldBeacon $should_beacon_header_val;
|
|
proxy_hide_header PS-ShouldBeacon;
|
|
}
|
|
}
|
|
|
|
server {
|
|
listen @@SECONDARY_PORT@@;
|
|
listen [::]:@@SECONDARY_PORT@@;
|
|
server_name if-in-server.example.com;
|
|
pagespeed FileCachePath "@@SECONDARY_CACHE@@";
|
|
|
|
pagespeed RewriteLevel PassThrough;
|
|
set $inline_javascript "No";
|
|
|
|
if ($http_x_custom_header_inline_js) {
|
|
# TODO(jefftk): Turn on NGX_HTTP_SIF_CONF and figure out how to get
|
|
# pagespeed directives inside of a server location block to be respected,
|
|
# then uncomment the following line and duplicate the if-in-location test
|
|
# for if-in-server.
|
|
#pagespeed EnableFilters inline_javascript;
|
|
set $inline_javascript "Yes";
|
|
}
|
|
|
|
add_header "X-Inline-Javascript" $inline_javascript;
|
|
}
|
|
|
|
server {
|
|
listen @@SECONDARY_PORT@@;
|
|
listen [::]:@@SECONDARY_PORT@@;
|
|
server_name if-in-location.example.com;
|
|
pagespeed FileCachePath "@@SECONDARY_CACHE@@";
|
|
|
|
|
|
location / {
|
|
set $inline_javascript "No";
|
|
pagespeed RewriteLevel PassThrough;
|
|
|
|
if ($http_x_custom_header_inline_js) {
|
|
pagespeed EnableFilters inline_javascript;
|
|
set $inline_javascript "Yes";
|
|
}
|
|
|
|
add_header "X-Inline-Javascript" $inline_javascript;
|
|
}
|
|
}
|
|
|
|
server {
|
|
listen @@SECONDARY_PORT@@;
|
|
listen [::]:@@SECONDARY_PORT@@;
|
|
server_name secondary.example.com;
|
|
pagespeed FileCachePath "@@SECONDARY_CACHE@@";
|
|
|
|
pagespeed MapProxyDomain secondary.example.com/gstatic_images
|
|
http://www.gstatic.com/psa/static;
|
|
}
|
|
|
|
# These three vhosts are for testing the experiment framework (Furious).
|
|
server {
|
|
listen @@SECONDARY_PORT@@;
|
|
listen [::]:@@SECONDARY_PORT@@;
|
|
server_name experiment.example.com;
|
|
pagespeed FileCachePath "@@FILE_CACHE@@";
|
|
pagespeed InPlaceResourceOptimization off;
|
|
|
|
pagespeed RunExperiment on;
|
|
pagespeed AnalyticsID "123-45-6734";
|
|
pagespeed UseAnalyticsJs false;
|
|
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";
|
|
pagespeed ExperimentSpec "id=3;default;percent=0";
|
|
}
|
|
server {
|
|
listen @@SECONDARY_PORT@@;
|
|
listen [::]:@@SECONDARY_PORT@@;
|
|
server_name contentexperiment.example.com;
|
|
pagespeed FileCachePath "@@FILE_CACHE@@";
|
|
pagespeed InPlaceResourceOptimization off;
|
|
|
|
pagespeed RunExperiment on;
|
|
pagespeed AnalyticsID "123-45-6734";
|
|
pagespeed UseAnalyticsJs false;
|
|
pagespeed ExperimentVariable 2;
|
|
pagespeed ExperimentSpec
|
|
"id=7;enable=recompress_images;disable=convert_jpeg_to_progressive;percent=50;options=ContentExperimentID=ID:H1BpS2TCRFmJzZgjwyeBHQ,ContentExperimentVariantID=111";
|
|
pagespeed ExperimentSpec
|
|
"id=2;enable=recompress_images;percent=50;options=ContentExperimentID=ID:H1BpS2TCRFmJzZgjwyeBHQ,ContentExperimentVariantID=222";
|
|
pagespeed ExperimentSpec
|
|
"id=3;default;percent=0;options=ContentExperimentID=123,ContentExperimentVariantID=333";
|
|
}
|
|
server {
|
|
listen @@SECONDARY_PORT@@;
|
|
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";
|
|
pagespeed ExperimentSpec "id=3;default;percent=0";
|
|
}
|
|
server {
|
|
listen @@SECONDARY_PORT@@;
|
|
listen [::]:@@SECONDARY_PORT@@;
|
|
server_name experiment.devicematch.example.com;
|
|
pagespeed FileCachePath "@@FILE_CACHE@@";
|
|
|
|
pagespeed RunExperiment on;
|
|
pagespeed ExperimentSpec
|
|
"id=1;percent=100;matches_device_type=mobile;enable=recompress_images";
|
|
}
|
|
|
|
server {
|
|
listen @@SECONDARY_PORT@@;
|
|
listen [::]:@@SECONDARY_PORT@@;
|
|
server_name experiment.ajax.example.com;
|
|
pagespeed FileCachePath "@@FILE_CACHE@@";
|
|
pagespeed RewriteLevel CoreFilters;
|
|
pagespeed DisableFilters add_instrumentation;
|
|
pagespeed JsInlineMaxBytes 1;
|
|
pagespeed RunExperiment on;
|
|
pagespeed UseAnalyticsJs false;
|
|
pagespeed ExperimentSpec "id=1;percent=100;level=CoreFilters;enable=collapse_whitespace;options=JsInlineMaxBytes=1";
|
|
}
|
|
|
|
server {
|
|
listen @@SECONDARY_PORT@@;
|
|
listen [::]:@@SECONDARY_PORT@@;
|
|
server_name ajax.example.com;
|
|
pagespeed FileCachePath "@@FILE_CACHE@@";
|
|
pagespeed RewriteLevel CoreFilters;
|
|
pagespeed EnableFilters add_instrumentation;
|
|
pagespeed JsInlineMaxBytes 1;
|
|
}
|
|
|
|
server {
|
|
listen @@SECONDARY_PORT@@;
|
|
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@@;
|
|
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 enabled to make sure that
|
|
# downstream caches and rebeaconing interact correctly.
|
|
listen @@SECONDARY_PORT@@;
|
|
listen [::]:@@SECONDARY_PORT@@;
|
|
server_name downstreamcacherebeacon.example.com;
|
|
pagespeed FileCachePath "@@FILE_CACHE@@";
|
|
|
|
pagespeed RewriteLevel PassThrough;
|
|
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;
|
|
location ~ .*[.]html {
|
|
add_header Cache-Control "private, max-age=3000";
|
|
}
|
|
}
|
|
|
|
server {
|
|
listen @@SECONDARY_PORT@@;
|
|
listen [::]:@@SECONDARY_PORT@@;
|
|
server_name downstreamcacheresource.example.com;
|
|
pagespeed FileCachePath "@@FILE_CACHE@@";
|
|
pagespeed RewriteLevel PassThrough;
|
|
pagespeed EnableFilters rewrite_images;
|
|
pagespeed DownstreamCachePurgeLocationPrefix "http://localhost:@@SECONDARY_PORT@@/purge";
|
|
}
|
|
|
|
# Set up a reverse proxy (rproxy.) and origin (origin.) as vhosts for
|
|
# showing that we can configure PageSpeed via response headers.
|
|
server {
|
|
listen @@SECONDARY_PORT@@;
|
|
listen [::]:@@SECONDARY_PORT@@;
|
|
server_name rproxy.rmcomments.example.com;
|
|
pagespeed FileCachePath "@@FILE_CACHE@@";
|
|
pagespeed RewriteLevel PassThrough;
|
|
pagespeed DisableFilters add_instrumentation,remove_comments;
|
|
|
|
# Note that we don't enable remove_comments here; that setting comes from
|
|
# the response headers from origin.rmcomments.example.com
|
|
location / {
|
|
proxy_pass http://127.0.0.1:@@SECONDARY_PORT@@/;
|
|
proxy_set_header "Host" "origin.rmcomments.example.com";
|
|
}
|
|
}
|
|
server {
|
|
listen @@SECONDARY_PORT@@;
|
|
listen [::]:@@SECONDARY_PORT@@;
|
|
server_name origin.rmcomments.example.com;
|
|
pagespeed FileCachePath "@@FILE_CACHE@@";
|
|
pagespeed off;
|
|
location / {
|
|
add_header PageSpeedFilters remove_comments;
|
|
}
|
|
}
|
|
|
|
server {
|
|
listen @@SECONDARY_PORT@@;
|
|
listen [::]:@@SECONDARY_PORT@@;
|
|
server_name renderedimagebeacon.example.com;
|
|
pagespeed FileCachePath "@@FILE_CACHE@@";
|
|
|
|
pagespeed RewriteLevel PassThrough;
|
|
pagespeed EnableFilters resize_rendered_image_dimensions;
|
|
pagespeed CriticalImagesBeaconEnabled true;
|
|
}
|
|
|
|
|
|
# Build a configuration hierarchy where at the root we have turned on
|
|
# OptimizeForBandwidth, and in various subdirectories we override settings
|
|
# to make them more aggressive.
|
|
server {
|
|
listen @@SECONDARY_PORT@@;
|
|
listen [::]:@@SECONDARY_PORT@@;
|
|
server_name optimizeforbandwidth.example.com;
|
|
pagespeed FileCachePath "@@FILE_CACHE@@";
|
|
|
|
pagespeed RewriteLevel OptimizeForBandwidth;
|
|
pagespeed DisableFilters add_instrumentation;
|
|
|
|
location /mod_pagespeed_test/optimize_for_bandwidth/inline_css {
|
|
pagespeed EnableFilters inline_css;
|
|
}
|
|
location /mod_pagespeed_test/optimize_for_bandwidth/css_urls {
|
|
pagespeed CssPreserveURLs off;
|
|
}
|
|
location /mod_pagespeed_test/optimize_for_bandwidth/image_urls {
|
|
pagespeed ImagePreserveURLs off;
|
|
}
|
|
location /mod_pagespeed_test/optimize_for_bandwidth/core_filters {
|
|
pagespeed RewriteLevel CoreFilters;
|
|
}
|
|
}
|
|
|
|
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@@;
|
|
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;
|
|
# Don't use localhost, as ngx_pagespeed's native fetcher cannot resolve it
|
|
pagespeed MapOriginDomain 127.0.0.1:@@SECONDARY_PORT@@/customhostheader
|
|
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@@;
|
|
listen [::]:@@SECONDARY_PORT@@;
|
|
server_name forbidden.example.com;
|
|
pagespeed FileCachePath "@@FILE_CACHE@@";
|
|
|
|
|
|
# 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@@;
|
|
listen [::]:@@SECONDARY_PORT@@;
|
|
server_name unauthorizedresources.example.com;
|
|
pagespeed FileCachePath "@@FILE_CACHE@@";
|
|
|
|
pagespeed RewriteLevel PassThrough;
|
|
pagespeed InlineResourcesWithoutExplicitAuthorization Script,Stylesheet;
|
|
pagespeed CssInlineMaxBytes 1000000;
|
|
}
|
|
|
|
server {
|
|
listen @@SECONDARY_PORT@@;
|
|
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@@;
|
|
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;
|
|
pagespeed UrlValuedAttribute link data-stylesheet Stylesheet;
|
|
pagespeed UrlValuedAttribute span data-stylesheet-a Stylesheet;
|
|
pagespeed UrlValuedAttribute span data-stylesheet-b Stylesheet;
|
|
pagespeed UrlValuedAttribute span data-stylesheet-c Stylesheet;
|
|
|
|
# Also test that we can redefine spec-defined attributes.
|
|
pagespeed UrlValuedAttribute blockquote cite Image;
|
|
}
|
|
|
|
server {
|
|
listen 127.0.0.2:@@SECONDARY_PORT@@;
|
|
server_name loopbackfetch.example.com;
|
|
pagespeed FileCachePath "@@FILE_CACHE@@";
|
|
}
|
|
|
|
server {
|
|
listen @@SECONDARY_PORT@@;
|
|
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@@;
|
|
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 {
|
|
# Test host for shared memory cache.
|
|
listen @@SECONDARY_PORT@@;
|
|
listen [::]:@@SECONDARY_PORT@@;
|
|
server_name shmcache.example.com;
|
|
pagespeed FileCachePath "@@SHM_CACHE@@";
|
|
|
|
pagespeed RewriteLevel PassThrough;
|
|
pagespeed EnableFilters rewrite_images;
|
|
}
|
|
|
|
server {
|
|
listen @@SECONDARY_PORT@@;
|
|
listen [::]:@@SECONDARY_PORT@@;
|
|
server_name xfp.example.com;
|
|
pagespeed FileCachePath "@@FILE_CACHE@@";
|
|
pagespeed RespectXForwardedProto on;
|
|
|
|
location /redirecting_origin {
|
|
pagespeed off;
|
|
# Hack: we clear the response headers using headers_more.
|
|
# If we don't, nginx will add an extra empty Location: headers here.
|
|
# It is kind of hard to get nginx to generate a relative location header
|
|
# that starts with "/".
|
|
more_clear_headers 'Location';
|
|
add_header Location /mod_pagespeed_example;
|
|
return 301;
|
|
}
|
|
location /redirect {
|
|
proxy_method GET;
|
|
proxy_pass http://127.0.0.1:@@SECONDARY_PORT@@/redirecting_origin;
|
|
proxy_set_header "Host" "xfp.example.com";
|
|
}
|
|
}
|
|
|
|
server {
|
|
listen @@SECONDARY_PORT@@;
|
|
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@@;
|
|
listen [::]:@@SECONDARY_PORT@@;
|
|
server_name embed-config-html.example.org;
|
|
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;
|
|
|
|
# Share a cache keyspace with embed-config-resources.example.com.
|
|
pagespeed CacheFragment "embed-config";
|
|
|
|
pagespeed LoadFromFile "http://embed-config-resources.example.com/"
|
|
"@@SERVER_ROOT@@/mod_pagespeed_example/";
|
|
}
|
|
|
|
server {
|
|
listen @@SECONDARY_PORT@@;
|
|
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.org.
|
|
|
|
# Share a cache keyspace with embed-config-html.example.org.
|
|
pagespeed CacheFragment "embed-config";
|
|
|
|
pagespeed LoadFromFile "http://embed-config-resources.example.com/"
|
|
"@@SERVER_ROOT@@/mod_pagespeed_example/";
|
|
}
|
|
|
|
server {
|
|
listen @@SECONDARY_PORT@@;
|
|
listen [::]:@@SECONDARY_PORT@@;
|
|
server_name ipro-for-browser.example.com;
|
|
root "@@SERVER_ROOT@@/mod_pagespeed_example";
|
|
pagespeed EnableFilters rewrite_images,rewrite_css;
|
|
pagespeed EnableFilters convert_to_webp_lossless;
|
|
pagespeed EnableFilters in_place_optimize_for_browser;
|
|
pagespeed JpegRecompressionQuality 75;
|
|
pagespeed WebpRecompressionQuality 70;
|
|
pagespeed InPlaceResourceOptimization on;
|
|
pagespeed AllowVaryOn "Accept";
|
|
pagespeed FileCachePath "@@IPRO_CACHE@@";
|
|
}
|
|
|
|
server {
|
|
listen @@SECONDARY_PORT@@;
|
|
listen [::]:@@SECONDARY_PORT@@;
|
|
server_name ipro-for-browser-vary-on-auto.example.com;
|
|
root "@@SERVER_ROOT@@/mod_pagespeed_example";
|
|
pagespeed EnableFilters rewrite_images,rewrite_css;
|
|
pagespeed EnableFilters convert_to_webp_animated;
|
|
pagespeed EnableFilters convert_to_webp_lossless;
|
|
pagespeed EnableFilters in_place_optimize_for_browser;
|
|
pagespeed InPlaceResourceOptimization on;
|
|
# pagespeed AllowVaryOn "Accept"; # Default is "Auto".
|
|
pagespeed ImageRecompressionQuality 90;
|
|
pagespeed JpegRecompressionQuality 75;
|
|
pagespeed JpegRecompressionQualityForSmallScreens 55;
|
|
pagespeed JpegQualityForSaveData 35;
|
|
pagespeed WebpRecompressionQuality 70;
|
|
pagespeed WebpRecompressionQualityForSmallScreens 50;
|
|
pagespeed WebpQualityForSaveData 30;
|
|
pagespeed WebpAnimatedRecompressionQuality 60;
|
|
pagespeed FileCachePath "@@IPRO_CACHE@@";
|
|
}
|
|
|
|
server {
|
|
listen @@SECONDARY_PORT@@;
|
|
listen [::]:@@SECONDARY_PORT@@;
|
|
server_name ipro-for-browser-vary-on-none.example.com;
|
|
root "@@SERVER_ROOT@@/mod_pagespeed_example";
|
|
pagespeed EnableFilters rewrite_images,in_place_optimize_for_browser;
|
|
pagespeed InPlaceResourceOptimization on;
|
|
pagespeed AllowVaryOn "None";
|
|
pagespeed ImageRecompressionQuality 75;
|
|
pagespeed FileCachePath "@@IPRO_CACHE@@";
|
|
}
|
|
|
|
server {
|
|
listen @@SECONDARY_PORT@@;
|
|
listen [::]:@@SECONDARY_PORT@@;
|
|
server_name respectvary.example.com;
|
|
pagespeed FileCachePath "@@FILE_CACHE@@";
|
|
|
|
pagespeed RespectVary on;
|
|
add_header Vary User-Agent;
|
|
}
|
|
|
|
server {
|
|
listen @@SECONDARY_PORT@@;
|
|
listen [::]:@@SECONDARY_PORT@@;
|
|
server_name cache_a.example.com;
|
|
pagespeed FileCachePath "@@FILE_CACHE@@";
|
|
|
|
pagespeed CacheFlushPollIntervalSec 1;
|
|
pagespeed RewriteLevel PassThrough;
|
|
pagespeed EnableFilters inline_css;
|
|
|
|
# Make a non-empty subdirectory config to make sure that
|
|
# cache.flush updates get transmitted to nested configurations.
|
|
#
|
|
# TODO(jmarantz): This test currently fails on ngx_pagespeed, meaning we
|
|
# don't handle cache flushing correctly here. Uncomment the config below to
|
|
# expose the error.
|
|
#location /mod_pagespeed_test/cache_flush/ {
|
|
# pagespeed RewriteLevel PassThrough;
|
|
# pagespeed EnableFilters inline_css;
|
|
# pagespeed DisableFilters add_instrumentation;
|
|
#}
|
|
}
|
|
|
|
server {
|
|
listen @@SECONDARY_PORT@@;
|
|
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@@;
|
|
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@@;
|
|
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;
|
|
pagespeed CacheFragment "example";
|
|
}
|
|
server {
|
|
# Sets up a logical origin for CDNs to fetch content from, on
|
|
# origin.example.com.
|
|
listen @@SECONDARY_PORT@@;
|
|
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;
|
|
pagespeed CacheFragment "example";
|
|
}
|
|
server {
|
|
# Sets up a logical cdn, which is where we tell browsers to fetch resources
|
|
# from.
|
|
listen @@SECONDARY_PORT@@;
|
|
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@@;
|
|
listen [::]:@@SECONDARY_PORT@@;
|
|
server_name lff-ipro.example.com;
|
|
pagespeed FileCachePath "@@FILE_CACHE@@";
|
|
|
|
pagespeed LoadFromFile
|
|
"http://lff-ipro.example.com/mod_pagespeed_example/lff_ipro"
|
|
"@@SERVER_ROOT@@/mod_pagespeed_example/lff_ipro";
|
|
}
|
|
|
|
server {
|
|
listen @@SECONDARY_PORT@@;
|
|
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@@;
|
|
listen [::]:@@SECONDARY_PORT@@;
|
|
server_name modpagespeed.com;
|
|
pagespeed FileCachePath "@@FILE_CACHE@@";
|
|
|
|
pagespeed off;
|
|
|
|
location / {
|
|
proxy_pass http://modpagespeed.com;
|
|
}
|
|
}
|
|
|
|
server {
|
|
listen @@SECONDARY_PORT@@;
|
|
listen [::]:@@SECONDARY_PORT@@;
|
|
server_name custom-paths.example.com;
|
|
pagespeed FileCachePath "@@FILE_CACHE@@";
|
|
|
|
pagespeed StatisticsPath /custom_pagespeed_statistics;
|
|
pagespeed ConsolePath /custom_pagespeed_console;
|
|
pagespeed MessagesPath /custom_pagespeed_message;
|
|
pagespeed AdminPath /custom_pagespeed_admin;
|
|
|
|
pagespeed StatisticsDomains Allow *;
|
|
pagespeed GlobalStatisticsDomains Allow *;
|
|
pagespeed MessagesDomains Allow *;
|
|
pagespeed ConsoleDomains Allow *;
|
|
pagespeed AdminDomains Allow *;
|
|
pagespeed GlobalAdminDomains Allow *;
|
|
}
|
|
|
|
server {
|
|
listen @@SECONDARY_PORT@@;
|
|
listen [::]:@@SECONDARY_PORT@@;
|
|
server_name inherit-paths.example.com;
|
|
pagespeed FileCachePath "@@FILE_CACHE@@";
|
|
|
|
pagespeed StatisticsDomains Allow *;
|
|
pagespeed GlobalStatisticsDomains Allow *;
|
|
pagespeed MessagesDomains Allow *;
|
|
pagespeed ConsoleDomains Allow *;
|
|
pagespeed AdminDomains Allow *;
|
|
pagespeed GlobalAdminDomains Allow *;
|
|
}
|
|
|
|
server {
|
|
listen @@SECONDARY_PORT@@;
|
|
listen [::]:@@SECONDARY_PORT@@;
|
|
server_name blocking.example.com;
|
|
pagespeed FileCachePath "@@SECONDARY_CACHE@@";
|
|
|
|
pagespeed RewriteLevel PassThrough;
|
|
pagespeed EnableFilters rewrite_images;
|
|
}
|
|
|
|
server {
|
|
listen @@SECONDARY_PORT@@;
|
|
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@@;
|
|
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@@;
|
|
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@@;
|
|
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@@;
|
|
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@@;
|
|
listen [::]:@@SECONDARY_PORT@@;
|
|
server_name response-header-filters.example.com;
|
|
pagespeed FileCachePath "@@SECONDARY_CACHE@@";
|
|
pagespeed RewriteLevel PassThrough;
|
|
pagespeed on;
|
|
location / {
|
|
proxy_pass http://localhost:@@SECONDARY_PORT@@;
|
|
proxy_set_header Host "enable-filter-header-origin.example.com";
|
|
}
|
|
}
|
|
|
|
server {
|
|
listen @@SECONDARY_PORT@@;
|
|
listen [::]:@@SECONDARY_PORT@@;
|
|
server_name response-header-disable.example.com;
|
|
pagespeed FileCachePath "@@SECONDARY_CACHE@@";
|
|
pagespeed EnableFilters add_instrumentation;
|
|
pagespeed on;
|
|
location / {
|
|
proxy_pass http://localhost:@@SECONDARY_PORT@@;
|
|
proxy_set_header Host "pagespeed-off-header-origin.example.com";
|
|
}
|
|
}
|
|
|
|
server {
|
|
listen @@SECONDARY_PORT@@;
|
|
listen [::]:@@SECONDARY_PORT@@;
|
|
server_name headers.example.com;
|
|
pagespeed InPlaceRewriteDeadlineMs -1;
|
|
pagespeed FileCachePath "@@SECONDARY_CACHE@@";
|
|
pagespeed LoadFromFile "http://headers.example.com/"
|
|
"@@SERVER_ROOT@@/";
|
|
location /mod_pagespeed_test/ {
|
|
more_set_headers "Server: override";
|
|
more_set_headers -s '404' 'Cache-Control: override';
|
|
}
|
|
}
|
|
|
|
server {
|
|
listen @@SECONDARY_PORT@@;
|
|
listen [::]:@@SECONDARY_PORT@@;
|
|
server_name custom404.example.com;
|
|
pagespeed FileCachePath "@@SECONDARY_CACHE@@";
|
|
error_page 404 /404.html;
|
|
}
|
|
|
|
server {
|
|
listen @@SECONDARY_PORT@@;
|
|
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;
|
|
}
|
|
|
|
location /mod_pagespeed_test/ipro/no-cache-control-header {
|
|
add_header Cache-Control "";
|
|
pagespeed ImplicitCacheTtlMs 333000;
|
|
}
|
|
}
|
|
|
|
# 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@@;
|
|
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@@;
|
|
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@@;
|
|
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@@;
|
|
listen [::]:@@SECONDARY_PORT@@;
|
|
server_name noned-nonem.example.com;
|
|
pagespeed FileCachePath "@@SECONDARY_CACHE@@_noned_nonem";
|
|
|
|
pagespeed EnableFilters rewrite_images;
|
|
pagespeed CriticalImagesBeaconEnabled false;
|
|
}
|
|
|
|
server {
|
|
listen @@SECONDARY_PORT@@;
|
|
listen [::]:@@SECONDARY_PORT@@;
|
|
server_name date.example.com;
|
|
pagespeed FileCachePath "@@FILE_CACHE@@";
|
|
add_header "Date" "Fri, 16 Oct 2009 23:05:07 GMT";
|
|
}
|
|
|
|
server {
|
|
listen @@SECONDARY_PORT@@;
|
|
listen [::]:@@SECONDARY_PORT@@;
|
|
server_name options-by-cookies-enabled.example.com;
|
|
pagespeed FileCachePath "@@SECONDARY_CACHE@@_optionsbycookieson";
|
|
pagespeed AllowOptionsToBeSetByCookies true;
|
|
pagespeed StickyQueryParameters sticky_secret;
|
|
pagespeed RewriteLevel PassThrough;
|
|
pagespeed EnableFilters collapse_whitespace;
|
|
pagespeed DisableFilters remove_comments,add_instrumentation;
|
|
}
|
|
|
|
server {
|
|
listen @@SECONDARY_PORT@@;
|
|
listen [::]:@@SECONDARY_PORT@@;
|
|
server_name options-by-cookies-disabled.example.com;
|
|
pagespeed FileCachePath "@@SECONDARY_CACHE@@_optionsbycookiesoff";
|
|
pagespeed AllowOptionsToBeSetByCookies false;
|
|
pagespeed DisableFilters add_instrumentation;
|
|
}
|
|
|
|
server {
|
|
listen @@SECONDARY_PORT@@;
|
|
listen [::]:@@SECONDARY_PORT@@;
|
|
server_name redirect.example.com;
|
|
pagespeed FileCachePath "@@SECONDARY_CACHE@@_redirected";
|
|
pagespeed RewriteLevel PassThrough;
|
|
pagespeed EnableFilters add_instrumentation,collapse_whitespace;
|
|
location /redirect {
|
|
rewrite ^/redirect/(.*) http://$server_name/$1 permanent;
|
|
}
|
|
}
|
|
|
|
server {
|
|
listen @@SECONDARY_PORT@@;
|
|
listen [::]:@@SECONDARY_PORT@@;
|
|
server_name request-option-override.example.com;
|
|
pagespeed FileCachePath "@@SECONDARY_CACHE@@";
|
|
pagespeed RequestOptionOverride abc;
|
|
pagespeed RewriteLevel Passthrough;
|
|
pagespeed EnableFilters collapse_whitespace;
|
|
pagespeed DisableFilters remove_comments,add_instrumentation;
|
|
}
|
|
|
|
server {
|
|
listen @@SECONDARY_PORT@@;
|
|
listen [::]:@@SECONDARY_PORT@@;
|
|
server_name signed-urls.example.com;
|
|
pagespeed FileCachePath "@@SECONDARY_CACHE@@";
|
|
pagespeed UrlSigningKey helloworld;
|
|
pagespeed RewriteLevel Passthrough;
|
|
pagespeed EnableFilters collapse_whitespace,rewrite_images;
|
|
pagespeed DisableFilters remove_comments,add_instrumentation;
|
|
}
|
|
|
|
# For testing signed URLs, ignoring signature validity.
|
|
server {
|
|
listen @@SECONDARY_PORT@@;
|
|
listen [::]:@@SECONDARY_PORT@@;
|
|
server_name signed-urls-transition.example.com;
|
|
pagespeed FileCachePath "@@SECONDARY_CACHE@@";
|
|
pagespeed UrlSigningKey helloworld;
|
|
pagespeed AcceptInvalidSignatures true;
|
|
pagespeed RewriteLevel Passthrough;
|
|
pagespeed EnableFilters collapse_whitespace,rewrite_images;
|
|
pagespeed DisableFilters remove_comments,add_instrumentation;
|
|
}
|
|
server {
|
|
listen @@SECONDARY_PORT@@;
|
|
listen [::]:@@SECONDARY_PORT@@;
|
|
server_name unsigned-urls-transition.example.com;
|
|
pagespeed FileCachePath "@@SECONDARY_CACHE@@";
|
|
# This server will not sign URLs, but AcceptInvalidSignature is on.
|
|
pagespeed AcceptInvalidSignatures true;
|
|
pagespeed RewriteLevel Passthrough;
|
|
pagespeed EnableFilters collapse_whitespace,rewrite_images;
|
|
pagespeed DisableFilters remove_comments,add_instrumentation;
|
|
}
|
|
|
|
# Start remote config servers.
|
|
server {
|
|
listen @@SECONDARY_PORT@@;
|
|
listen [::]:@@SECONDARY_PORT@@;
|
|
server_name remote-config.example.com;
|
|
pagespeed FileCachePath "@@SECONDARY_CACHE@@";
|
|
pagespeed RemoteConfigurationUrl "http://127.0.0.1:@@RCPORT@@/standard";
|
|
pagespeed RemoteConfigurationTimeoutMs 1500;
|
|
}
|
|
server {
|
|
listen @@SECONDARY_PORT@@;
|
|
listen [::]:@@SECONDARY_PORT@@;
|
|
server_name remote-config-partially-invalid.example.com;
|
|
pagespeed FileCachePath "@@SECONDARY_CACHE@@";
|
|
pagespeed RemoteConfigurationUrl
|
|
"http://127.0.0.1:@@RCPORT@@/partly-invalid";
|
|
pagespeed RemoteConfigurationTimeoutMs 1500;
|
|
}
|
|
server {
|
|
listen @@SECONDARY_PORT@@;
|
|
listen [::]:@@SECONDARY_PORT@@;
|
|
server_name remote-config-invalid.example.com;
|
|
pagespeed FileCachePath "@@SECONDARY_CACHE@@";
|
|
pagespeed RemoteConfigurationUrl "http://127.0.0.1:@@RCPORT@@/invalid";
|
|
pagespeed RemoteConfigurationTimeoutMs 1500;
|
|
}
|
|
server {
|
|
listen @@SECONDARY_PORT@@;
|
|
listen [::]:@@SECONDARY_PORT@@;
|
|
server_name remote-config-failed-fetch.example.com;
|
|
pagespeed FileCachePath "@@SECONDARY_CACHE@@";
|
|
pagespeed RemoteConfigurationUrl "http://127.0.0.1:@@RCPORT@@/fail-future";
|
|
pagespeed RemoteConfigurationTimeoutMs 1500;
|
|
}
|
|
server {
|
|
listen @@SECONDARY_PORT@@;
|
|
listen [::]:@@SECONDARY_PORT@@;
|
|
server_name remote-config-slow-fetch.example.com;
|
|
pagespeed FileCachePath "@@SECONDARY_CACHE@@";
|
|
pagespeed RemoteConfigurationUrl "http://127.0.0.1:@@RCPORT@@/timeout";
|
|
pagespeed RemoteConfigurationTimeoutMs 1500;
|
|
}
|
|
server {
|
|
listen @@SECONDARY_PORT@@;
|
|
listen [::]:@@SECONDARY_PORT@@;
|
|
server_name remote-config-experiment.example.com;
|
|
pagespeed FileCachePath "@@SECONDARY_CACHE@@";
|
|
pagespeed RemoteConfigurationUrl "http://127.0.0.1:@@RCPORT@@/experiment";
|
|
pagespeed RemoteConfigurationTimeoutMs 1500;
|
|
}
|
|
server {
|
|
listen @@SECONDARY_PORT@@;
|
|
listen [::]:@@SECONDARY_PORT@@;
|
|
server_name remote-config-slightly-slow-fetch.example.com;
|
|
pagespeed FileCachePath "@@SECONDARY_CACHE@@";
|
|
pagespeed RemoteConfigurationUrl
|
|
"http://127.0.0.1:@@RCPORT@@/slightly-slow";
|
|
pagespeed RemoteConfigurationTimeoutMs 1500;
|
|
}
|
|
server {
|
|
listen @@SECONDARY_PORT@@;
|
|
listen [::]:@@SECONDARY_PORT@@;
|
|
server_name remote-config-slightly-slow-expired-fetch.example.com;
|
|
pagespeed FileCachePath "@@SECONDARY_CACHE@@";
|
|
pagespeed RemoteConfigurationUrl "http://127.0.0.1:@@RCPORT@@/slow-expired";
|
|
pagespeed RemoteConfigurationTimeoutMs 1500;
|
|
}
|
|
server {
|
|
listen @@SECONDARY_PORT@@;
|
|
listen [::]:@@SECONDARY_PORT@@;
|
|
server_name remote-config-forbidden.example.com;
|
|
pagespeed FileCachePath "@@SECONDARY_CACHE@@";
|
|
pagespeed RemoteConfigurationUrl "http://127.0.0.1:@@RCPORT@@/forbidden";
|
|
pagespeed RemoteConfigurationTimeoutMs 1500;
|
|
}
|
|
server {
|
|
listen @@SECONDARY_PORT@@;
|
|
listen [::]:@@SECONDARY_PORT@@;
|
|
server_name remote-config-initially-forbidden.example.com;
|
|
pagespeed FileCachePath "@@SECONDARY_CACHE@@";
|
|
pagespeed RemoteConfigurationUrl
|
|
"http://127.0.0.1:@@RCPORT@@/forbidden-once";
|
|
pagespeed RemoteConfigurationTimeoutMs 1500;
|
|
}
|
|
|
|
# Test that pagespeed is disabled when sendfile headers are present.
|
|
server {
|
|
listen @@SECONDARY_PORT@@;
|
|
listen [::]:@@SECONDARY_PORT@@;
|
|
server_name uses-sendfile.example.com;
|
|
pagespeed FileCachePath "@@SECONDARY_CACHE@@";
|
|
pagespeed EnableFilters inline_javascript,rewrite_javascript;
|
|
add_header 'X-Sendfile' 'blablabla';
|
|
}
|
|
server {
|
|
listen @@SECONDARY_PORT@@;
|
|
listen [::]:@@SECONDARY_PORT@@;
|
|
server_name doesnt-sendfile.example.com;
|
|
pagespeed FileCachePath "@@SECONDARY_CACHE@@";
|
|
pagespeed EnableFilters inline_javascript,rewrite_javascript;
|
|
}
|
|
server {
|
|
listen @@SECONDARY_PORT@@;
|
|
listen [::]:@@SECONDARY_PORT@@;
|
|
server_name uses-xaccelredirect.example.com;
|
|
pagespeed FileCachePath "@@SECONDARY_CACHE@@";
|
|
pagespeed EnableFilters inline_javascript,rewrite_javascript;
|
|
add_header 'X-Accel-Redirect' 'blablabla';
|
|
}
|
|
|
|
server {
|
|
listen @@SECONDARY_PORT@@;
|
|
listen [::]:@@SECONDARY_PORT@@;
|
|
server_name map-static-domain.example.com;
|
|
pagespeed FileCachePath "@@SECONDARY_CACHE@@";
|
|
pagespeed MapRewriteDomain http://static-cdn.example.com
|
|
http://map-static-domain.example.com;
|
|
pagespeed RewriteLevel PassThrough;
|
|
pagespeed EnableFilters defer_javascript,rewrite_domains;
|
|
}
|
|
|
|
# Proxy + IPRO a gzip'd file for testing Issue 896.
|
|
server {
|
|
listen @@SECONDARY_PORT@@;
|
|
listen [::]:@@SECONDARY_PORT@@;
|
|
server_name ipro-proxy.example.com;
|
|
pagespeed FileCachePath "@@FILE_CACHE@@_ipro_proxy";
|
|
|
|
pagespeed on;
|
|
pagespeed InPlaceResourceOptimization on;
|
|
pagespeed EnableFilters rewrite_domains;
|
|
|
|
location / {
|
|
proxy_pass
|
|
"http://localhost:@@PRIMARY_PORT@@/mod_pagespeed_test/ipro/mod_deflate/";
|
|
}
|
|
}
|
|
|
|
server {
|
|
listen @@SECONDARY_PORT@@;
|
|
listen [::]:@@SECONDARY_PORT@@;
|
|
server_name compressedcache.example.com;
|
|
pagespeed on;
|
|
pagespeed FileCachePath "@@FILE_CACHE@@";
|
|
pagespeed EnableFilters rewrite_css;
|
|
pagespeed HttpCacheCompressionLevel 9;
|
|
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;
|
|
fastcgi_buffering off;
|
|
}
|
|
}
|
|
|
|
server {
|
|
listen @@SECONDARY_PORT@@;
|
|
listen [::]:@@SECONDARY_PORT@@;
|
|
server_name uncompressedcache.example.com;
|
|
pagespeed on;
|
|
pagespeed FileCachePath "@@FILE_CACHE@@";
|
|
pagespeed EnableFilters rewrite_css;
|
|
pagespeed HttpCacheCompressionLevel 0;
|
|
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;
|
|
fastcgi_buffering off;
|
|
}
|
|
}
|
|
|
|
server {
|
|
listen @@SECONDARY_PORT@@;
|
|
listen [::]:@@SECONDARY_PORT@@;
|
|
server_name compressed-css.example.com;
|
|
pagespeed on;
|
|
pagespeed FileCachePath "@@FILE_CACHE@@";
|
|
pagespeed InPlaceResourceOptimization on;
|
|
}
|
|
|
|
# nested gzip config: pagespeed gzip on/off
|
|
server {
|
|
pagespeed on;
|
|
listen @@SECONDARY_PORT@@;
|
|
listen [::]:@@SECONDARY_PORT@@;
|
|
server_name gzip-test1.example.com;
|
|
pagespeed FileCachePath "@@FILE_CACHE@@";
|
|
location /mod_pagespeed_example/ {
|
|
pagespeed gzip off;
|
|
}
|
|
location /mod_pagespeed_example/styles/ {
|
|
pagespeed gzip on;
|
|
}
|
|
}
|
|
|
|
# nested gzip config: pagespeed on/off
|
|
server {
|
|
pagespeed on;
|
|
listen @@SECONDARY_PORT@@;
|
|
listen [::]:@@SECONDARY_PORT@@;
|
|
server_name gzip-test2.example.com;
|
|
pagespeed FileCachePath "@@FILE_CACHE@@";
|
|
location /mod_pagespeed_example/ {
|
|
pagespeed off;
|
|
}
|
|
location /mod_pagespeed_example/styles/ {
|
|
pagespeed on;
|
|
}
|
|
}
|
|
|
|
server {
|
|
pagespeed on;
|
|
pagespeed EnableFilters add_instrumentation;
|
|
listen @@SECONDARY_PORT@@;
|
|
listen [::]:@@SECONDARY_PORT@@;
|
|
server_name proxy-post.example.com;
|
|
pagespeed FileCachePath "@@FILE_CACHE@@";
|
|
|
|
location / {
|
|
# Transform the POST to a GET request for the origin,
|
|
# as nginx's static handler doesn't allow POST requests.
|
|
proxy_method GET;
|
|
proxy_pass http://127.0.0.1:@@SECONDARY_PORT@@/;
|
|
proxy_set_header "Host" "proxy-post-origin.example.com";
|
|
}
|
|
}
|
|
|
|
server {
|
|
pagespeed off;
|
|
listen @@SECONDARY_PORT@@;
|
|
listen [::]:@@SECONDARY_PORT@@;
|
|
server_name proxy-post-origin.example.com;
|
|
pagespeed FileCachePath "@@FILE_CACHE@@";
|
|
root "@@SERVER_ROOT@@/";
|
|
}
|
|
|
|
server {
|
|
# Write all post data to temp files
|
|
client_body_in_file_only clean;
|
|
pagespeed CriticalImagesBeaconEnabled true;
|
|
listen @@SECONDARY_PORT@@;
|
|
listen [::]:@@SECONDARY_PORT@@;
|
|
server_name beacon-post-temp-file.example.com;
|
|
pagespeed FileCachePath "@@FILE_CACHE@@";
|
|
}
|
|
|
|
server {
|
|
listen @@SECONDARY_PORT@@;
|
|
listen [::]:@@SECONDARY_PORT@@;
|
|
server_name script-filters.example.com;
|
|
pagespeed FileCachePath "@@FILE_CACHE@@";
|
|
root "@@SERVER_ROOT@@/";
|
|
set $filters "";
|
|
set $domain_shards "cdn1.example.com,cdn2.example.com";
|
|
if ($http_X_Script) {
|
|
set $filters "add_instrumentation";
|
|
set $domain_shards "";
|
|
}
|
|
pagespeed RewriteLevel PassThrough;
|
|
pagespeed EnableFilters rewrite_domains;
|
|
pagespeed EnableFilters $filters;
|
|
pagespeed ShardDomain script-filters.example.com "$domain_shards";
|
|
}
|
|
|
|
server {
|
|
listen @@SECONDARY_PORT@@;
|
|
listen [::]:@@SECONDARY_PORT@@;
|
|
server_name purge.example.com;
|
|
|
|
# Test purging individual URLs without flushing the entire metadata cache.
|
|
pagespeed EnableCachePurge on;
|
|
|
|
pagespeed PurgeMethod PURGE;
|
|
root "@@SERVER_ROOT@@/purge";
|
|
pagespeed FileCachePath "@@FILE_CACHE@@_purge";
|
|
pagespeed DisableFilters add_instrumentation;
|
|
pagespeed RewriteLevel PassThrough;
|
|
pagespeed EnableFilters rewrite_css;
|
|
}
|
|
|
|
server {
|
|
listen @@SECONDARY_PORT@@;
|
|
listen [::]:@@SECONDARY_PORT@@;
|
|
server_name psoff-dir-on.example.com;
|
|
|
|
# Test purging individual URLs without flushing the entire metadata cache.
|
|
pagespeed EnableCachePurge on;
|
|
|
|
pagespeed PurgeMethod PURGE;
|
|
root "@@SERVER_ROOT@@/purge";
|
|
pagespeed FileCachePath "@@FILE_CACHE@@_dir_on";
|
|
pagespeed DisableFilters add_instrumentation;
|
|
pagespeed RewriteLevel PassThrough;
|
|
pagespeed EnableFilters rewrite_css;
|
|
pagespeed off;
|
|
location / {
|
|
pagespeed on;
|
|
}
|
|
}
|
|
|
|
server {
|
|
listen @@SECONDARY_PORT@@;
|
|
listen [::]:@@SECONDARY_PORT@@;
|
|
server_name cc-header-origin.example.com;
|
|
pagespeed InPlaceResourceOptimization off;
|
|
pagespeed off;
|
|
pagespeed FileCachePath "@@FILE_CACHE@@";
|
|
root "@@SERVER_ROOT@@/";
|
|
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";
|
|
}
|
|
}
|
|
|
|
server {
|
|
listen @@SECONDARY_PORT@@;
|
|
listen [::]:@@SECONDARY_PORT@@;
|
|
server_name enable-filter-header-origin.example.com;
|
|
pagespeed InPlaceResourceOptimization off;
|
|
pagespeed off;
|
|
pagespeed FileCachePath "@@FILE_CACHE@@";
|
|
root "@@SERVER_ROOT@@/";
|
|
location / {
|
|
add_header "PageSpeedFilters" "add_instrumentation";
|
|
}
|
|
}
|
|
|
|
server {
|
|
listen @@SECONDARY_PORT@@;
|
|
listen [::]:@@SECONDARY_PORT@@;
|
|
server_name pagespeed-off-header-origin.example.com;
|
|
pagespeed InPlaceResourceOptimization off;
|
|
pagespeed off;
|
|
pagespeed FileCachePath "@@FILE_CACHE@@";
|
|
root "@@SERVER_ROOT@@/";
|
|
location / {
|
|
add_header "PageSpeed" "off";
|
|
}
|
|
}
|
|
|
|
pagespeed MessagesDomains Allow messages-allowed.example.com;
|
|
pagespeed MessagesDomains Allow cleared-inherited.example.com;
|
|
pagespeed MessagesDomains Allow cleared-inherited-reallowed.example.com;
|
|
pagespeed MessagesDomains Allow more-messages-allowed.example.com;
|
|
pagespeed MessagesDomains Allow anything-*-wildcard.example.com;
|
|
pagespeed MessagesDomains Allow localhost;
|
|
|
|
server {
|
|
listen @@SECONDARY_PORT@@;
|
|
listen [::]:@@SECONDARY_PORT@@;
|
|
server_name messages-allowed.example.com
|
|
messages-not-allowed.example.com
|
|
more-messages-allowed.example.com
|
|
anything-a-wildcard.example.com
|
|
anything-b-wildcard.example.com;
|
|
pagespeed FileCachePath "@@FILE_CACHE@@";
|
|
}
|
|
server {
|
|
listen @@SECONDARY_PORT@@;
|
|
listen [::]:@@SECONDARY_PORT@@;
|
|
server_name messages-still-not-allowed.example.com
|
|
but-this-message-allowed.example.com
|
|
and-this-one.example.com;
|
|
pagespeed MessagesDomains Allow but-this-message-allowed.example.com;
|
|
pagespeed MessagesDomains Allow and-this-one.example.com;
|
|
pagespeed FileCachePath "@@FILE_CACHE@@";
|
|
}
|
|
server {
|
|
listen @@SECONDARY_PORT@@;
|
|
listen [::]:@@SECONDARY_PORT@@;
|
|
server_name cleared-inherited.example.com
|
|
cleared-inherited-reallowed.example.com
|
|
messages-allowed-at-vhost.example.com
|
|
messages-not-allowed-at-vhost.example.com
|
|
anything-c-wildcard.example.com;
|
|
pagespeed MessagesDomains Disallow *;
|
|
pagespeed MessagesDomains Allow cleared-inherited-reallowed.example.com;
|
|
pagespeed MessagesDomains Allow messages-allowed-at-vhost.example.com;
|
|
pagespeed FileCachePath "@@FILE_CACHE@@";
|
|
}
|
|
server {
|
|
listen @@SECONDARY_PORT@@;
|
|
listen [::]:@@SECONDARY_PORT@@;
|
|
server_name cleared-inherited-unlisted.example.com;
|
|
pagespeed MessagesDomains Allow *;
|
|
pagespeed FileCachePath "@@FILE_CACHE@@";
|
|
}
|
|
server {
|
|
server_name nothing-allowed.example.com;
|
|
pagespeed MessagesDomains Disallow *;
|
|
pagespeed FileCachePath "@@FILE_CACHE@@";
|
|
}
|
|
server {
|
|
server_name nothing-explicitly-allowed.example.com;
|
|
pagespeed FileCachePath "@@FILE_CACHE@@";
|
|
}
|
|
server {
|
|
listen @@SECONDARY_PORT@@;
|
|
listen [::]:@@SECONDARY_PORT@@;
|
|
server_name everything-explicitly-allowed.example.com
|
|
everything-explicitly-allowed-but-aliased.example.com;
|
|
pagespeed FileCachePath "@@FILE_CACHE@@";
|
|
|
|
pagespeed StatisticsDomains Allow everything-explicitly-allowed.example.com;
|
|
pagespeed GlobalStatisticsDomains
|
|
Allow everything-explicitly-allowed.example.com;
|
|
pagespeed MessagesDomains Allow everything-explicitly-allowed.example.com;
|
|
pagespeed ConsoleDomains Allow everything-explicitly-allowed.example.com;
|
|
pagespeed AdminDomains Allow everything-explicitly-allowed.example.com;
|
|
pagespeed GlobalAdminDomains
|
|
Allow everything-explicitly-allowed.example.com;
|
|
}
|
|
server {
|
|
listen @@SECONDARY_PORT@@;
|
|
listen [::]:@@SECONDARY_PORT@@;
|
|
server_name psol-vary.example.com;
|
|
pagespeed on;
|
|
pagespeed InPlaceResourceOptimization on;
|
|
pagespeed FileCachePath "@@FILE_CACHE@@";
|
|
}
|
|
server {
|
|
pagespeed on;
|
|
listen @@SECONDARY_PORT@@;
|
|
listen [::]:@@SECONDARY_PORT@@;
|
|
server_name flush.example.com;
|
|
pagespeed FileCachePath "@@FILE_CACHE@@";
|
|
pagespeed RewriteLevel PassThrough;
|
|
pagespeed RewriteDeadlinePerFlushMs 1;
|
|
|
|
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;
|
|
fastcgi_buffering off;
|
|
}
|
|
}
|
|
server {
|
|
pagespeed on;
|
|
listen @@SECONDARY_PORT@@;
|
|
listen [::]:@@SECONDARY_PORT@@;
|
|
server_name noflush.example.com;
|
|
pagespeed FileCachePath "@@FILE_CACHE@@";
|
|
pagespeed RewriteLevel PassThrough;
|
|
pagespeed RewriteDeadlinePerFlushMs 1;
|
|
pagespeed FollowFlushes off;
|
|
|
|
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;
|
|
fastcgi_buffering off;
|
|
}
|
|
}
|
|
server {
|
|
pagespeed on;
|
|
listen @@SECONDARY_PORT@@;
|
|
listen [::]:@@SECONDARY_PORT@@;
|
|
server_name special-response.example.com;
|
|
pagespeed FileCachePath "@@FILE_CACHE@@";
|
|
error_page 404 /mod_pagespeed_test/php_withflush.php;
|
|
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;
|
|
}
|
|
}
|
|
server {
|
|
pagespeed on;
|
|
listen @@SECONDARY_PORT@@;
|
|
listen [::]:@@SECONDARY_PORT@@;
|
|
server_name debug-filters.example.com;
|
|
pagespeed FileCachePath "@@FILE_CACHE@@";
|
|
pagespeed RewriteLevel PassThrough;
|
|
pagespeed EnableFilters debug;
|
|
}
|
|
server {
|
|
pagespeed on;
|
|
listen @@SECONDARY_PORT@@;
|
|
listen [::]:@@SECONDARY_PORT@@;
|
|
server_name broken-fetch.example.com;
|
|
pagespeed FileCachePath "@@FILE_CACHE@@/broken-fetch";
|
|
|
|
# Set up a fetch proxy that will 404 every request.
|
|
pagespeed FetchProxy "brokenfetch.example.com:1111";
|
|
|
|
# Prevent loopback fetch by explicitly authorizing the domain. Loopback
|
|
# fetches would work, and for this test, we're trying to have fetches fail,
|
|
# so they are instead picked up by the ipro recorder.
|
|
pagespeed Domain http://broken-fetch.example.com;
|
|
pagespeed InPlaceResourceOptimization on;
|
|
|
|
pagespeed RewriteLevel PassThrough;
|
|
pagespeed EnableFilters rewrite_javascript;
|
|
pagespeed DisableFilters add_instrumentation;
|
|
pagespeed CriticalImagesBeaconEnabled false;
|
|
}
|
|
server {
|
|
listen @@PRIMARY_PORT@@;
|
|
listen [::]:@@PRIMARY_PORT@@;
|
|
server_name localhost;
|
|
pagespeed FileCachePath "@@FILE_CACHE@@";
|
|
|
|
location ~ ^/pagespeed_admin {
|
|
allow 127.0.0.1;
|
|
allow ::1;
|
|
deny all;
|
|
}
|
|
|
|
location ~ "\.pagespeed\.([a-z]\.)?[a-z]{2}\.[^.]{10}\.[^.]+" {
|
|
# TODO(oschaaf): The following breaks nginx starting up, as the bad header
|
|
# value gets rejected during configuration parsing. However, we can't easily
|
|
# build a test for that right now.
|
|
# pagespeed AddResourceHeader "X-Fo\n\no" "Bar";
|
|
# pagespeed AddResourceHeader "X-Foo" "Ba\nr";
|
|
|
|
# For testing that AddResourceHeader gets passed through
|
|
pagespeed AddResourceHeader "X-Foo" "Bar";
|
|
add_header "" "";
|
|
}
|
|
|
|
# Backend for ipro-proxy.example.com
|
|
location /mod_pagespeed_test/ipro/mod_deflate/ {
|
|
pagespeed off;
|
|
}
|
|
|
|
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";
|
|
pagespeed DownstreamCacheRebeaconingKey "random_rebeaconing_key";
|
|
# 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;
|
|
pagespeed CriticalImagesBeaconEnabled true;
|
|
add_header Cache-Control "public, max-age=100";
|
|
}
|
|
|
|
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';
|
|
}
|
|
|
|
location /mod_pagespeed_test/no_transform {
|
|
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 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;
|
|
pagespeed RetainComment " google_ad_section*";
|
|
pagespeed PermitIdsForCssCombining "allowed-to-combine-1-*";
|
|
pagespeed PermitIdsForCssCombining "allowed-to-combine-2-*";
|
|
|
|
# Test proxying of non-.pagespeed. resources.
|
|
pagespeed MapProxyDomain http://localhost:@@PRIMARY_PORT@@/modpagespeed_http
|
|
http://@@PAGESPEED_TEST_HOST@@/do_not_modify;
|
|
pagespeed MapProxyDomain http://localhost:@@PRIMARY_PORT@@/content_type_present
|
|
http://@@PAGESPEED_TEST_HOST@@:8091;
|
|
pagespeed MapProxyDomain http://localhost:@@PRIMARY_PORT@@/content_type_absent
|
|
http://@@PAGESPEED_TEST_HOST@@:8092;
|
|
|
|
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;
|
|
allow ::1;
|
|
deny all;
|
|
}
|
|
|
|
location /ngx_pagespeed_message {
|
|
allow 127.0.0.1;
|
|
allow ::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 {
|
|
proxy_pass http://localhost:@@SECONDARY_PORT@@;
|
|
proxy_set_header Host "cc-header-origin.example.com";
|
|
}
|
|
|
|
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;
|
|
}
|
|
|
|
location /mod_pagespeed_test/example.json {
|
|
expires 10m;
|
|
}
|
|
|
|
location /mod_pagespeed_test/ipro/cc200/ {
|
|
add_header "Cache-Control" "max-age=200";
|
|
}
|
|
location /mod_pagespeed_test/ipro/cc200p/ {
|
|
add_header "Cache-Control" "private, max-age=200";
|
|
}
|
|
location /mod_pagespeed_test/ipro/cc200nc/ {
|
|
add_header "Cache-Control" "no-cache, max-age=200";
|
|
}
|
|
location /mod_pagespeed_test/ipro/cc200ns/ {
|
|
add_header "Cache-Control" "no-store, max-age=200";
|
|
}
|
|
location /mod_pagespeed_test/ipro/cc200nt/ {
|
|
add_header "Cache-Control" "no-transform, max-age=200";
|
|
}
|
|
location /mod_pagespeed_test/ipro/cc200sma5/ {
|
|
add_header "Cache-Control" "s-maxage=5, max-age=200";
|
|
}
|
|
location /mod_pagespeed_test/ipro/cc200sma50/ {
|
|
add_header "Cache-Control" "s-maxage=50, max-age=200";
|
|
}
|
|
location /mod_pagespeed_test/ipro/cc200sma50nsp/ {
|
|
add_header "Cache-Control" "s-maxage=50,max-age=200";
|
|
}
|
|
location /mod_pagespeed_test/ipro/cc9/ {
|
|
add_header "Cache-Control" "max-age=9";
|
|
}
|
|
location /mod_pagespeed_test/ipro/cc200cc9/ {
|
|
add_header "Cache-Control" "max-age=200, max-age=9";
|
|
}
|
|
location /mod_pagespeed_test/ipro/cc200sma50sma5/ {
|
|
add_header "Cache-Control" "max-age=200, s-maxage=50, s-maxage=5";
|
|
}
|
|
location /mod_pagespeed_test/ipro/cc200sma50cc9/ {
|
|
add_header "Cache-Control" "max-age=200, s-maxage=50, max-age=9";
|
|
}
|
|
location /mod_pagespeed_test/ipro/cc200sma50cc9nsp/ {
|
|
add_header "Cache-Control" "max-age=200,s-maxage=50,max-age=9";
|
|
}
|
|
location /mod_pagespeed_test/ipro/cc200sma50sma51/ {
|
|
add_header "Cache-Control" "max-age=200, s-maxage=50, s-maxage=51";
|
|
}
|
|
|
|
location /mod_pagespeed_test/ipro/wait/ {
|
|
# TODO(jmarantz): ModPagespeedInPlaceWaitForOptimized should be superfluous,
|
|
# or made equivalent to ModPagespeedInPlaceRewriteDeadlineMs -1, which waits
|
|
# forever. Otherwise ModPagespeedInPlaceRewriteDeadlineMs should just have
|
|
# the specified deadline.
|
|
# # See https://github.com/pagespeed/mod_pagespeed/issues/1171 for more
|
|
# detailed discussion.
|
|
pagespeed InPlaceWaitForOptimized on;
|
|
}
|
|
|
|
location /mod_pagespeed_test/ipro/wait/long/ {
|
|
# Make the deadline long here for valgrind tests. We could
|
|
# conditionalize this.
|
|
pagespeed InPlaceRewriteDeadlineMs 10000;
|
|
}
|
|
|
|
location /mod_pagespeed_test/ipro/wait/short/ {
|
|
pagespeed EnableFilters in_place_optimize_for_browser;
|
|
|
|
# Make the deadline short here as we expect to always miss it
|
|
# in tests.
|
|
pagespeed InPlaceRewriteDeadlineMs 1;
|
|
}
|
|
|
|
location /mod_pagespeed_test/ipro/instant/wait/ {
|
|
pagespeed InPlaceWaitForOptimized on;
|
|
|
|
# TODO(jefftk): When running with valgrind we need to raise the rewrite
|
|
# deadline or else we get "Deadline exceeded for rewrite of resource".
|
|
# I had thought InPlaceWaitForOptimized was supposed to disable the
|
|
# rewrite deadline, but it seems not to.
|
|
#
|
|
# InPlaceWaitForOptimized is definitely doing something, though: when I
|
|
# remove the InPlaceRewriteDeadlineMs line below and run without valgrind,
|
|
# purple.css is optimized via ipro on the first request but if I set
|
|
# InPlaceWaitForOptimized to off then it is not.
|
|
pagespeed InPlaceRewriteDeadlineMs 1000;
|
|
}
|
|
|
|
location /mod_pagespeed_test/ipro/instant/deadline/ {
|
|
set $ps_deadline -1;
|
|
pagespeed ImageRecompressionQuality $ps_deadline;
|
|
pagespeed InPlaceRewriteDeadlineMs $ps_deadline;
|
|
}
|
|
|
|
# Test to make sure that user-authenticated resources do not get cached and
|
|
# optimized.
|
|
location /mod_pagespeed_test/auth/ {
|
|
auth_basic "Restricted";
|
|
auth_basic_user_file "@@SERVER_ROOT@@/mod_pagespeed_test/auth/passwd.conf";
|
|
}
|
|
|
|
location /mod_pagespeed_test/ipro/cookie/ {
|
|
# Add Vary:Cookie. This should prevent us from optimizing the
|
|
# vary_cookie.css even though PagespeedRespectVary is off.
|
|
# test/nginx_system_test.sh does the fetches test with and w/o cookies.
|
|
add_header Vary Cookie;
|
|
pagespeed RespectVary off;
|
|
pagespeed InPlaceWaitForOptimized on;
|
|
}
|
|
|
|
location /mod_pagespeed_test/ipro/cookie2/ {
|
|
# Add Vary:Cookie2. This should prevent us from optimizing the
|
|
# vary_cookie2.css even though PagespeedRespectVary is off.
|
|
# test/nginx_system_test.sh does the fetches test with and w/o cookie2.
|
|
add_header Vary Cookie2;
|
|
pagespeed RespectVary off;
|
|
pagespeed InPlaceWaitForOptimized on;
|
|
}
|
|
|
|
location /mod_pagespeed_test/vary/ {
|
|
pagespeed RespectVary on;
|
|
}
|
|
|
|
location ~ /mod_pagespeed_test/vary/\.(js|css)$ {
|
|
add_header Vary User-Agent;
|
|
}
|
|
|
|
location /mod_pagespeed_test/vary/no_respect/ {
|
|
pagespeed DisableFilters add_instrumentation,inline_css;
|
|
pagespeed RespectVary off;
|
|
}
|
|
|
|
location /mod_pagespeed_test/experimental_js_minifier/ {
|
|
pagespeed UseExperimentalJsMinifier on;
|
|
}
|
|
|
|
pagespeed FetchHttps enable;
|
|
location /mod_pagespeed_test/https_fetch/ {
|
|
pagespeed DisableFilters inline_images;
|
|
set $ps_gstatic "https://www.gstatic.com/psa/static";
|
|
pagespeed MapProxyDomain
|
|
http://localhost:@@PRIMARY_PORT@@/https_gstatic_dot_com
|
|
$ps_gstatic;
|
|
}
|
|
|
|
location /mod_pagespeed_test/strip_subresource_hints/default/ {
|
|
pagespeed DisableFilters add_instrumentation;
|
|
pagespeed RewriteLevel CoreFilters;
|
|
pagespeed DisAllow *dontrewriteme*;
|
|
}
|
|
location /mod_pagespeed_test/strip_subresource_hints/default_passthrough/ {
|
|
pagespeed DisableFilters add_instrumentation;
|
|
pagespeed RewriteLevel PassThrough;
|
|
}
|
|
location /mod_pagespeed_test/strip_subresource_hints/preserve_on/ {
|
|
pagespeed DisableFilters add_instrumentation;
|
|
pagespeed PreserveSubresourceHints on;
|
|
pagespeed RewriteLevel CoreFilters;
|
|
}
|
|
location /mod_pagespeed_test/strip_subresource_hints/preserve_off/ {
|
|
pagespeed DisableFilters add_instrumentation;
|
|
pagespeed PreserveSubresourceHints off;
|
|
pagespeed RewriteLevel CoreFilters;
|
|
}
|
|
# $host implicitly tests script variable support. I'd love to test it more
|
|
# directly, but so far this is the best I've come up with and duplicating
|
|
# the test doesn't seem to make sense.
|
|
pagespeed LoadFromFile
|
|
"http://$host:@@PRIMARY_PORT@@/mod_pagespeed_test/ipro/instant/"
|
|
"@@SERVER_ROOT@@/mod_pagespeed_test/ipro/instant/";
|
|
|
|
location /mod_pagespeed_test/public/ {
|
|
add_header "Cache-Control" "public, max-age=600";
|
|
pagespeed PreserveUrlRelativity off;
|
|
}
|
|
|
|
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$ps_dollar;
|
|
pagespeed LoadFromFileRuleMatch Allow exception\.ssp\.css$ps_dollar;
|
|
#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;
|
|
|
|
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/json json;
|
|
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;
|
|
|
|
}
|