rewrite domain for assets to use cdn with both http and https

131 views
Skip to first unread message

rag...@googlemail.com

unread,
Oct 28, 2016, 4:29:55 AM10/28/16
to mod-pagespeed-discuss
In my local setup, mod_pagespeed does rewrite assets to use the configuted cdn domain perfectly.
However, if i access the site via https, it does not rewrite a single asset.
Thou pagespeed is active on https sites (debug output and Headers show this) and there is no error in stdoutput/erroutput or the log.

I have been trying to get this to work for two days now and i am stuck.

Here is my config and i also added the debug output of the https call:
<IfModule pagespeed_module>
    ModPagespeed on
    ModPagespeedFileCachePath "/var/cache/mod_pagespeed/"
    ModPagespeedLogDir "/var/log/pagespeed"
    ModPagespeedSslCertDirectory "/etc/ssl/certs"
    ModPagespeedRewriteLevel PassThrough
    ModPagespeedEnableFilters rewrite_domains,debug


    ModPagespeedDomain cdn.example.dev
    ModPagespeedMapRewriteDomain cdn.example.dev *example.dev
</IfModule>


Here's the debug output from the html:
<!--
mod_pagespeed on
Filters:
db Debug
hw Flushes html
rd Rewrite Domains


Options:
EnableRewriting (e) 1
FileCacheInodeLimit (afcl) 500000
ModifyCachingHeaders (mch) True
RespectXForwardedProto (rxfp) True
RewriteDeadlinePerFlushMs (rdm) 10
RewriteLevel (l) Pass Through
StatisticsLogging (asle) True


#NumFlushes            0
#EndDocument after     2549us
#Total Parse duration  2169us
#Total Render duration 1769us
#Total Idle duration   380us
The following filters were disabled for this request:
 SupportNoscript
-->


How do i get mod_pagespeed to rewrite urls on https as well?

Otto van der Schaaf

unread,
Oct 28, 2016, 5:56:21 AM10/28/16
to mod-pagespeed-discuss
Could you try adding this?:

ModPagespeedMapRewriteDomain cdn.example.dev https://*example.dev

Otto



--
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/f3f797dd-77c3-46cc-8f06-b0f927379d94%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

rag...@googlemail.com

unread,
Oct 28, 2016, 6:06:24 AM10/28/16
to mod-pagespeed-discuss
i tried, no differnce thou


Am Freitag, 28. Oktober 2016 11:56:21 UTC+2 schrieb Otto van der Schaaf:
Could you try adding this?:
ModPagespeedMapRewriteDomain cdn.example.dev https://*example.dev

Otto

[..]

Otto van der Schaaf

unread,
Oct 28, 2016, 6:21:19 AM10/28/16
to mod-pagespeed-discuss
If url rewriting still is not applied, all I can think of is that somehow mod_pagespeed thinks that the html is not served from either https://*example.dev or http://*example.dev
Just to make sure, are you sure you got the incoming hostname right?

I noticed you have RespectXForwardedProto enabled, are we seeing the complete picture setup- and configuration-wise?

Otto


--
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.

rag...@googlemail.com

unread,
Oct 28, 2016, 7:21:11 AM10/28/16
to mod-pagespeed-discuss
Am Freitag, 28. Oktober 2016 12:21:19 UTC+2 schrieb Otto van der Schaaf:
If url rewriting still is not applied, all I can think of is that somehow mod_pagespeed thinks that the html is not served from either https://*example.dev or http://*example.dev
Just to make sure, are you sure you got the incoming hostname right?

Yes. The setup is local and i call https://example.dev or http://example.dev locally without www. That is the domain defined in the chost setup as well.
I noticed you have RespectXForwardedProto enabled, are we seeing the complete picture setup- and configuration-wise?

In the Setup where this will be deployed the apache sits on serveral nodes behind two varnishes wich sit behind an ngnix. That's what that attribute is for. My local setup is just one apache, so this should not be a problem.

Steve Hill

unread,
Nov 14, 2016, 2:02:20 PM11/14/16
to mod-pagesp...@googlegroups.com
I'm pretty suspicious of "ModPagespeedRewriteLevel PassThrough" in that config. Do you have some other per-vhost config that actually enables more filters?

--
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-discuss+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mod-pagespeed-discuss/4ad489a0-8dce-4838-9af7-5230c8caf698%40googlegroups.com.

rag...@googlemail.com

unread,
Nov 16, 2016, 2:21:41 AM11/16/16
to mod-pagespeed-discuss
In the Line below i set

ModPagespeedEnableFilters rewrite_domains,debug

which is what enables rewrite_domains.
Reply all
Reply to author
Forward
0 new messages