Re: ModPageSpeed turns relative urls into absolute ones, and messes up HTTPS

231 views
Skip to first unread message

Joshua Marantz

unread,
Oct 24, 2012, 10:31:14 PM10/24/12
to mod-pagespeed-discuss
mod_pagespeed must not realize your page is being displayed as HTTPS.  Are you terminating SSL in a proxy of some sort and Apache is just working with HTTP?

No matter, you can in this case put
    ModPagespeedMapRewriteDomain https://foo.com http://foo.com
into pagespeed.conf and it will map the URLs for you.

Alternatively you can add the filter 'trim_urls' which will try to strip the URLs based on mod_pagespeed's perception of the base URL of the page.

Please see also these bugs:




On Wed, Oct 24, 2012 at 10:24 PM, Nick R <nickre...@gmail.com> wrote:
The extend cache filter is breaking my site.  It appears to be replacing relative urls like /foo.js with absolute ones like http://foo.com/foo.js.pagespeed.jm.3C-n5JmHYZ.js.  Unfortunately, my server is configured to only serve things over https, so all of these resources fail to serve.  ModPageSpeed should realize that if the html page is served over https, the assets should be too, but it doesn't.  How do I fix this?

Joshua Marantz

unread,
Apr 18, 2013, 3:31:38 PM4/18/13
to mod-pagespeed-discuss
See https://code.google.com/p/modpagespeed/issues/detail?id=503 (as referenced above).  I hear you: we need to have a mode (the default mode probably) where we leave the paths exactly as they are rather than absolutifying them.  This is not impossible; we just haven't done it yet.

But I'm hopeful you can use trim_urls as a workaround if you turn off MPS-rewriting for ajax requests as described in Issue 503.  What are the specific problems you found with trim_urls?

-Josh

Joshua Marantz

unread,
Apr 18, 2013, 5:41:42 PM4/18/13
to mod-pagespeed-discuss
Yes I agree.  I will bump up the priority of that bug as you are not the only one to notice.

-Josh



On Thu, Apr 18, 2013 at 4:36 PM, Dustin Glidden <dustin....@gmail.com> wrote:
That worked, thanks!  Certain dynamic content was broken before (eg certain posts had the wrong destination) but that seems to have fixed it.  It would be nice if this were default behavior though as you said.  It might make sense to absolutify the paths if one more of the original paths were absolute, but when absolutely all of them are relative to the root they should be left alone.
--
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.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Reply all
Reply to author
Forward
0 new messages