I have an apache server configured as a reverse proxy with pagespeed installed on it. Traffic is proxied to a backend server and resources are sharded to a CDN. The backend has one html file that references a css file which has one background image among other things. (I am attaching the html file and css file and pasting the apache configuration below).
Problem details
The proxy/pagespeed server is configured to shard resources to a cdn. The background image is being sharded incorrectly.
My shard is: http://shard1.lagrange.ninja/abckey
The css file is correctly sharded to http://shard1.lagrange.ninja/abckey/A.style2.css.pagespeed.cf._2C-rw2qWw.css
However the background url within the optimized css file is not sharded to http://shard1.lagrange.ninja/abckey
The error in the optimized css is:
body {
background-image: url("/xabsolute_web_page_background1.jpg.pagespeed.ic.t9nWGaBPUk.jpg");
}
This resource will be incorrectly fetched from http://shard1.lagrange.ninja/xabsolute_web_page_background1.jpg.pagespeed.ic.t9nWGaBPUk.jpg
The correct location is: http://shard1.lagrange.ninja/abckey/xabsolute_web_page_background1.jpg.pagespeed.ic.t9nWGaBPUk.jpg
The correct css would be:
body {
background-image: url("http://shard1.lagrange.ninja/abckey/xabsolute_web_page_background1.jpg.pagespeed.ic.t9nWGaBPUk.jpg");
}
The url of the reverse proxy where you can recreate the error is http://ani-test-backend.lagrange.ninja/welcome.html
NOTE: the background url in the css file is an absolute url. I have noticed that the problem does not recreate when using a relative url.
The apache vhost configuration on the reverse proxy
<VirtualHost *:80>
ServerName ani-test-backend.lagrange.ninja
<IfModule pagespeed_module>
ModPagespeed On
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript application/javascript text/javascript text/x-js text/x-javascript
ModPagespeedEnableFilters add_instrumentation
ModPagespeedDomain ani-test-backend.lagrange.ninja
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
ModPagespeedMapOriginDomain balancer://cluster_0_0/ ani-test-backend.lagrange.ninja/
# CDN Sharding is enabled.
ModPagespeedShardDomain http://ani-test-backend.lagrange.ninja http://shard1.lagrange.ninja/abckey
</IfModule>
ProxyPreserveHost On
####### balancers ########
<Proxy balancer://cluster_0_0>
BalancerMember http://130.211.199.75:80 route=0 timeout=600 retry=0 connectiontimeout=60 loadfactor=1
ProxySet lbmethod=bybusyness
</Proxy>
######### paths ##########
# ProxyPass configuration for path '/'.
ProxyPass /abckey/ balancer://cluster_0_0/
ProxyPass / balancer://cluster_0_0/
#ProxyPassReverse / balancer://cluster_0_0/
RequestHeader set X-Forwarded-Proto http
</VirtualHost>
I have been debugging this problem for several days now and appreciate any help that you can provide.
--
You received this message because you are subscribed to the Google Groups "mod-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-di...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mod-pagespeed-discuss/66372e96-f47e-4e8a-b644-3ea4feed342e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to mod-pagespeed-discuss+unsub...@googlegroups.com.
The url that is hitting the pagespeed-enabled proxy from CDN isGET /abckey/A.style2.css.pagespeed.cf._2C-rw2qWw.css HTTP/1.1" 200 ec7deca8-42c6-11e6-94ce-c940a41b48b4 398 20421 P "Amazon CloudFront" "ani-test-backend.lagrange.ninja" 54.240.149.15 - .
>> email to mod-pagespeed-discuss+unsub...@googlegroups.com.