Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e26507cd90 | |||
| 0fc4212cbd | |||
| 69fdc75b0b | |||
| 24213552a0 |
@@ -2622,6 +2622,16 @@ check_from "$OUT" egrep -iq $'^Cache-Control: .*\r$'
|
||||
check_from "$OUT" egrep -iq $'^Expires: .*\r$'
|
||||
check_from "$OUT" egrep -iq $'^Last-Modified: .*\r$'
|
||||
|
||||
# Verify that we can control pagespeed settings via a response
|
||||
# header passed from an origin to a reverse proxy.
|
||||
start_test Honor response header direcives from origin
|
||||
URL="http://rproxy.rmcomments.example.com/"
|
||||
URL+="mod_pagespeed_example/remove_comments.html"
|
||||
echo http_proxy=$SECONDARY_HOSTNAME $WGET_DUMP $URL ...
|
||||
OUT=$(http_proxy=$SECONDARY_HOSTNAME $WGET_DUMP $URL)
|
||||
check_from "$OUT" fgrep -q "remove_comments example"
|
||||
check_not_from "$OUT" fgrep -q "This comment will be removed"
|
||||
|
||||
# Test handling of large HTML files. We first test with a cold cache, and verify
|
||||
# that we bail out of parsing and insert a script redirecting to
|
||||
# ?PageSpeed=off. This should also insert an entry into the property cache so
|
||||
|
||||
@@ -351,6 +351,29 @@ http {
|
||||
pagespeed DownstreamCachePurgeLocationPrefix "http://localhost:@@SECONDARY_PORT@@/purge";
|
||||
}
|
||||
|
||||
server {
|
||||
listen @@SECONDARY_PORT@@;
|
||||
server_name origin.rmcomments.example.com;
|
||||
pagespeed off;
|
||||
add_header PageSpeedFilters remove_comments;
|
||||
}
|
||||
server {
|
||||
# Set up a reverse proxy (rproxy.) and origin (origin.) as vhosts for
|
||||
# showing that we can configure PageSpeed via response headers.
|
||||
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://localhost:@@SECONDARY_PORT@@;
|
||||
proxy_set_header X-Forwarded-For $remote_addr;
|
||||
proxy_set_header Host origin.rmcomments.example.com;
|
||||
}
|
||||
}
|
||||
|
||||
server {
|
||||
listen @@SECONDARY_PORT@@;
|
||||
server_name renderedimagebeacon.example.com;
|
||||
|
||||
Reference in New Issue
Block a user