Merge pull request #906 from pagespeed/oschaaf-trunk-tracking-module-position
module-position: optional switch to install at HTTP_AUX_FILTER_MODULES
This commit is contained in:
@@ -17,6 +17,8 @@
|
|||||||
# PSOL_BINARY: absolute path to pagespeed_automatic.a
|
# PSOL_BINARY: absolute path to pagespeed_automatic.a
|
||||||
|
|
||||||
mod_pagespeed_dir="${MOD_PAGESPEED_DIR:-unset}"
|
mod_pagespeed_dir="${MOD_PAGESPEED_DIR:-unset}"
|
||||||
|
position_aux="${POSITION_AUX:-unset}"
|
||||||
|
|
||||||
if [ "$mod_pagespeed_dir" = "unset" ] ; then
|
if [ "$mod_pagespeed_dir" = "unset" ] ; then
|
||||||
mod_pagespeed_dir="$ngx_addon_dir/psol/include"
|
mod_pagespeed_dir="$ngx_addon_dir/psol/include"
|
||||||
build_from_source=false
|
build_from_source=false
|
||||||
@@ -195,9 +197,14 @@ if [ $ngx_found = yes ]; then
|
|||||||
$ps_src/ngx_server_context.cc \
|
$ps_src/ngx_server_context.cc \
|
||||||
$ps_src/ngx_url_async_fetcher.cc"
|
$ps_src/ngx_url_async_fetcher.cc"
|
||||||
|
|
||||||
# Make pagespeed run immediately before gzip.
|
if [ "$position_aux" = "true" ] ; then
|
||||||
HTTP_FILTER_MODULES=$(echo $HTTP_FILTER_MODULES |\
|
HTTP_AUX_FILTER_MODULES="$HTTP_AUX_FILTER_MODULES $ngx_addon_name"
|
||||||
sed "s/$HTTP_GZIP_FILTER_MODULE/$HTTP_GZIP_FILTER_MODULE $ngx_addon_name/")
|
else
|
||||||
|
# Make pagespeed run immediately before gzip.
|
||||||
|
HTTP_FILTER_MODULES=$(echo $HTTP_FILTER_MODULES |\
|
||||||
|
sed "s/$HTTP_GZIP_FILTER_MODULE/$HTTP_GZIP_FILTER_MODULE $ngx_addon_name/")
|
||||||
|
fi
|
||||||
|
|
||||||
# Make the etag header filter run immediately after gzip.
|
# Make the etag header filter run immediately after gzip.
|
||||||
HTTP_FILTER_MODULES=$(echo $HTTP_FILTER_MODULES |\
|
HTTP_FILTER_MODULES=$(echo $HTTP_FILTER_MODULES |\
|
||||||
sed "s/$HTTP_GZIP_FILTER_MODULE/ngx_pagespeed_etag_filter $HTTP_GZIP_FILTER_MODULE/")
|
sed "s/$HTTP_GZIP_FILTER_MODULE/ngx_pagespeed_etag_filter $HTTP_GZIP_FILTER_MODULE/")
|
||||||
|
|||||||
+21
-14
@@ -33,6 +33,7 @@
|
|||||||
: ${SECONDARY_PORT:?"Set SECONDARY_PORT"}
|
: ${SECONDARY_PORT:?"Set SECONDARY_PORT"}
|
||||||
: ${MOD_PAGESPEED_DIR:?"Set MOD_PAGESPEED_DIR"}
|
: ${MOD_PAGESPEED_DIR:?"Set MOD_PAGESPEED_DIR"}
|
||||||
: ${NGINX_EXECUTABLE:?"Set NGINX_EXECUTABLE"}
|
: ${NGINX_EXECUTABLE:?"Set NGINX_EXECUTABLE"}
|
||||||
|
POSITION_AUX="${POSITION_AUX:-unset}"
|
||||||
|
|
||||||
PRIMARY_HOSTNAME="localhost:$PRIMARY_PORT"
|
PRIMARY_HOSTNAME="localhost:$PRIMARY_PORT"
|
||||||
SECONDARY_HOSTNAME="localhost:$SECONDARY_PORT"
|
SECONDARY_HOSTNAME="localhost:$SECONDARY_PORT"
|
||||||
@@ -287,10 +288,14 @@ BEACON_HANDLER="ngx_pagespeed_beacon"
|
|||||||
STATISTICS_URL=http://$PRIMARY_HOSTNAME/ngx_pagespeed_statistics
|
STATISTICS_URL=http://$PRIMARY_HOSTNAME/ngx_pagespeed_statistics
|
||||||
|
|
||||||
# An expected failure can be indicated like: "~In-place resource optimization~"
|
# An expected failure can be indicated like: "~In-place resource optimization~"
|
||||||
PAGESPEED_EXPECTED_FAILURES="
|
PAGESPEED_EXPECTED_FAILURES=""
|
||||||
~Override server header in resource flow.~
|
|
||||||
~Override server header in IPRO flow.~
|
if [ "$POSITION_AUX" = "true" ] ; then
|
||||||
|
PAGESPEED_EXPECTED_FAILURES+="
|
||||||
|
~server-side includes~
|
||||||
"
|
"
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
# Some tests are flakey under valgrind. For now, add them to the expected
|
# Some tests are flakey under valgrind. For now, add them to the expected
|
||||||
# failures when running under valgrind.
|
# failures when running under valgrind.
|
||||||
@@ -1155,18 +1160,20 @@ OUT=$(http_proxy=$SECONDARY_HOSTNAME $WGET_DUMP -O /dev/null -S $URL 2>&1)
|
|||||||
MATCHES=$(echo "$OUT" | grep -c "Server: override") || true
|
MATCHES=$(echo "$OUT" | grep -c "Server: override") || true
|
||||||
check [ $MATCHES -eq 1 ]
|
check [ $MATCHES -eq 1 ]
|
||||||
|
|
||||||
start_test Override server header in resource flow.
|
if [ "$POSITION_AUX" = "true" ] ; then
|
||||||
URL=http://headers.example.com/mod_pagespeed_test/
|
start_test Override server header in resource flow.
|
||||||
URL+=A.proxy_pass.css.pagespeed.cf.0.css
|
URL=http://headers.example.com/mod_pagespeed_test/
|
||||||
OUT=$(http_proxy=$SECONDARY_HOSTNAME $WGET_DUMP -O /dev/null -S $URL 2>&1)
|
URL+=A.proxy_pass.css.pagespeed.cf.0.css
|
||||||
MATCHES=$(echo "$OUT" | grep -c "Server: override") || true
|
OUT=$(http_proxy=$SECONDARY_HOSTNAME $WGET_DUMP -O /dev/null -S $URL 2>&1)
|
||||||
check [ $MATCHES -eq 1 ]
|
MATCHES=$(echo "$OUT" | grep -c "Server: override") || true
|
||||||
|
check [ $MATCHES -eq 1 ]
|
||||||
|
|
||||||
start_test Override server header in IPRO flow.
|
start_test Override server header in IPRO flow.
|
||||||
URL=http://headers.example.com/mod_pagespeed_test/proxy_pass.css
|
URL=http://headers.example.com/mod_pagespeed_test/proxy_pass.css
|
||||||
OUT=$(http_proxy=$SECONDARY_HOSTNAME $WGET_DUMP -O /dev/null -S $URL 2>&1)
|
OUT=$(http_proxy=$SECONDARY_HOSTNAME $WGET_DUMP -O /dev/null -S $URL 2>&1)
|
||||||
MATCHES=$(echo "$OUT" | grep -c "Server: override") || true
|
MATCHES=$(echo "$OUT" | grep -c "Server: override") || true
|
||||||
check [ $MATCHES -eq 1 ]
|
check [ $MATCHES -eq 1 ]
|
||||||
|
fi
|
||||||
|
|
||||||
start_test Conditional cache-control header override in resource flow.
|
start_test Conditional cache-control header override in resource flow.
|
||||||
URL=http://headers.example.com/mod_pagespeed_test/
|
URL=http://headers.example.com/mod_pagespeed_test/
|
||||||
|
|||||||
@@ -883,7 +883,10 @@ http {
|
|||||||
pagespeed FileCachePath "@@SECONDARY_CACHE@@";
|
pagespeed FileCachePath "@@SECONDARY_CACHE@@";
|
||||||
pagespeed RewriteLevel PassThrough;
|
pagespeed RewriteLevel PassThrough;
|
||||||
pagespeed on;
|
pagespeed on;
|
||||||
add_header PageSpeedFilters add_instrumentation;
|
location / {
|
||||||
|
proxy_pass http://localhost:@@SECONDARY_PORT@@;
|
||||||
|
proxy_set_header Host "enable-filter-header-origin.example.com";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
server {
|
server {
|
||||||
@@ -893,7 +896,24 @@ http {
|
|||||||
pagespeed FileCachePath "@@SECONDARY_CACHE@@";
|
pagespeed FileCachePath "@@SECONDARY_CACHE@@";
|
||||||
pagespeed EnableFilters add_instrumentation;
|
pagespeed EnableFilters add_instrumentation;
|
||||||
pagespeed on;
|
pagespeed on;
|
||||||
add_header PageSpeed off;
|
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 {
|
server {
|
||||||
@@ -976,7 +996,7 @@ http {
|
|||||||
listen [::]:@@SECONDARY_PORT@@;
|
listen [::]:@@SECONDARY_PORT@@;
|
||||||
server_name date.example.com;
|
server_name date.example.com;
|
||||||
pagespeed FileCachePath "@@FILE_CACHE@@";
|
pagespeed FileCachePath "@@FILE_CACHE@@";
|
||||||
add_header "Date" "Date: Fri, 16 Oct 2009 23:05:07 GMT";
|
add_header "Date" "Fri, 16 Oct 2009 23:05:07 GMT";
|
||||||
}
|
}
|
||||||
|
|
||||||
server {
|
server {
|
||||||
@@ -1183,17 +1203,41 @@ http {
|
|||||||
server {
|
server {
|
||||||
listen @@SECONDARY_PORT@@;
|
listen @@SECONDARY_PORT@@;
|
||||||
listen [::]:@@SECONDARY_PORT@@;
|
listen [::]:@@SECONDARY_PORT@@;
|
||||||
server_name headers.example.com;
|
server_name cc-header-origin.example.com;
|
||||||
|
pagespeed InPlaceResourceOptimization off;
|
||||||
|
pagespeed off;
|
||||||
|
pagespeed FileCachePath "@@FILE_CACHE@@";
|
||||||
root "@@SERVER_ROOT@@";
|
root "@@SERVER_ROOT@@";
|
||||||
pagespeed FileCachePath "@@FILE_CACHE@@_purge";
|
location /mod_pagespeed_test/nostore {
|
||||||
pagespeed RewriteLevel CoreFilters;
|
add_header "Cache-Control" "max-age=12345";
|
||||||
|
add_header "Cache-Control" "public, no-store";
|
||||||
|
add_header "Cache-Control" "max-age=14";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
pagespeed InPlaceRewriteDeadlineMs -1;
|
server {
|
||||||
pagespeed LoadFromFile "http://headers.example.com/"
|
listen @@SECONDARY_PORT@@;
|
||||||
"@@SERVER_ROOT@@/";
|
listen [::]:@@SECONDARY_PORT@@;
|
||||||
location /mod_pagespeed_test/ {
|
server_name enable-filter-header-origin.example.com;
|
||||||
more_set_headers "Server: override";
|
pagespeed InPlaceResourceOptimization off;
|
||||||
more_set_headers -s '404' 'Cache-Control: override';
|
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";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1286,9 +1330,8 @@ http {
|
|||||||
pagespeed AvoidRenamingIntrospectiveJavascript off;
|
pagespeed AvoidRenamingIntrospectiveJavascript off;
|
||||||
|
|
||||||
location /mod_pagespeed_test/nostore {
|
location /mod_pagespeed_test/nostore {
|
||||||
add_header "Cache-Control" "max-age=12345";
|
proxy_pass http://localhost:@@SECONDARY_PORT@@;
|
||||||
add_header "Cache-Control" "public, no-store";
|
proxy_set_header Host "cc-header-origin.example.com";
|
||||||
add_header "Cache-Control" "max-age=14";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
location /mod_pagespeed_test/forbid_all_disabled/disabled {
|
location /mod_pagespeed_test/forbid_all_disabled/disabled {
|
||||||
|
|||||||
Reference in New Issue
Block a user