Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have the following architecture on the web layer.

Varnish <-> Apache2 (mod_pagespeed <-> mod_jk) <-> Tomcat
    ^          ^                                      ^
    |          |                                      |________: mod_jk
    |          |_______________________________________________: port 8080
    |__________________________________________________________: port 80

Where varnish and mod_pagespeed is installed with default config.

Now when i access the url http://example.org:8080 then i can see in the source code that mod_pagespeed was invoked and has rewritten the page (on the second refresh mind you as it wasn't cached the first time)

However when i access the url http://example.org:80 mod_pagespeed is not invoked and the html code is rendered unchanged.

The following shows the http headers recieved on each junction

PORT 80
< Server: Apache/2.2.14 (Ubuntu)
< Set-Cookie: JSESSIONID=95ABA0EB57ACCBE15C9D7035C4397BD3; Path=/
< X-Mod-Pagespeed: 0.9.17.7-716
< Cache-Control: max-age=0, no-cache, no-store
< Vary: Accept-Encoding
< Content-Type: text/html;charset=UTF-8
< Content-Length: 13234
< Date: Wed, 01 Jun 2011 12:17:11 GMT
< X-Varnish: 579414176
< Age: 0
< Via: 1.1 varnish
< Connection: keep-alive

PORT 8080 (mod_pagespeed working fine)
< Date: Wed, 01 Jun 2011 12:19:26 GMT
< Server: Apache/2.2.14 (Ubuntu)
< Set-Cookie: JSESSIONID=DC3759CDE52D3B63A785F9C97B005EC0; Path=/
< X-Mod-Pagespeed: 0.9.17.7-716
< Cache-Control: max-age=0, no-cache, no-store
< Vary: Accept-Encoding
< Content-Length: 15990
< Content-Type: text/html;charset=UTF-8   

Does anyone have any clues as of why this is happening? is it a bug in mod_pagespeed? is it caused by a config setting which is or isn't set in varnish or mod_pagespeed?

Any help to further drill down this issue is greatly appreciated.

share|improve this question

migrated from stackoverflow.com Jun 3 '11 at 10:30

This question came from our site for professional and enthusiast programmers.

    
Is that the headers for example.org or http:/example.org:8080/ ? Or are they the same? If different, how? –  symcbean Aug 29 '13 at 22:51

1 Answer 1

up vote 0 down vote accepted

There are a lot of configuration pitfalls you can fall into when using mod_pagespeed on a backend server which receives different URLs than the end-user will see.

Your responses both have X-Mod-Pagespeed: headers, so mod_pagespeed is running on each of them, however, it is possible that it cannot load the sub-resources (CSS, JS, images) and so is not rewriting any of them.

Please follow up at mod-pagespeed-discuss@googlegroups.com and we can help you troubleshoot this.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.