Nginx, Varnish, Apache and Google PageSpeed

429 views
Skip to first unread message

Rafael El Mago

unread,
May 5, 2017, 10:09:30 PM5/5/17
to mod-pagespeed-discuss
Guys,

I am runnning NGINX on 443 (Proxy Pass), to terminate Varnish Cache. I set the Proto header and SSL On in NGINX config. 

I have Varnish on 80 & Apache with Google PageSpeed Module on 8080.

My SSL domains with Google PageSpeed load very slowwwwww...

I set ModPagespeedRespectXForwardedProto on


My questions is about configuring GPS


1) Do I have to enable or disable Fetch Https?

ModPagespeedFetchHttps enable  or disable


2) Which below do I use to properly authorize a domain or is it both?

ModPagespeedDomain https://www.example.com
ModPagespeedMapOriginDomain http://localhost https://www.example.com


3)Any other PageSpeed config that I am missing?

Rafael

Otto van der Schaaf

unread,
May 6, 2017, 3:26:47 PM5/6/17
to mod-pagespeed-discuss
1) Later versions have https fetching enabled by default, so probably no explicit enable is needed. Explicit authorization of the incoming domain is needed if you want mod_pagespeed to use dns when it attempts to fetch its inputs (without that it will use loopback fetching). If you use LoadFromFile (recommended if you have mostly static css/js/images), or MapOriginDomain to map to plain http via Varnish or Apache, https becomes irrelevant.
2) To authorize a domain you need ModPagespeedDomain. 
3) I'm wondering if the 8080 port shows up in rewritten .pagespeed. urls? If so, you may need to apply a ModPagespeedMapRewriteDomain line to correct that.

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/d04a2ede-7407-4d61-993c-082fd635a43b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Rafael El Mago

unread,
May 7, 2017, 4:42:58 PM5/7/17
to mod-pagespeed-discuss
@Otto

Thanks for your Prompt Response, I set Varnish Cache to rewrite to https on certain domains that I set SSL On.

Most of my sites are Wordpress or pure html. Slowly converting everything to Wordpress.

With my current Understanding and since you recommended LoadFromFile and piecing together info from different Sources is this correct:

ModPagespeedDomain https://www.example1.com
ModPagespeedDomain https://www.example2.com

ModPagespeedLoadFromFile "https://www.example1.com/wp-content/" "/home/user1/public_html/wp-content/"
ModPagespeedLoadFromFile "https://www.example2.com/wp-content/" "/home/user2/public_html/wp-content/"
ModPagespeedLoadFromFileRuleMatch disallow .*
ModPagespeedLoadFromFileRuleMatch allow \.(ico|pdf|swf|eot|woff|ttf|otf|css|js|jpeg|jpg|png|gif|svg|svgz|webp)$


Or what did I do wrong? Is the Rule Match Syntax correct?

My goal is to Varnish Cache my websites and have the GPS optimized content downstream cache as Fast As Possible.

Thanks for your help?

Rafael







On Saturday, May 6, 2017 at 12:26:47 PM UTC-7, Otto van der Schaaf wrote:
1) Later versions have https fetching enabled by default, so probably no explicit enable is needed. Explicit authorization of the incoming domain is needed if you want mod_pagespeed to use dns when it attempts to fetch its inputs (without that it will use loopback fetching). If you use LoadFromFile (recommended if you have mostly static css/js/images), or MapOriginDomain to map to plain http via Varnish or Apache, https becomes irrelevant.
2) To authorize a domain you need ModPagespeedDomain. 
3) I'm wondering if the 8080 port shows up in rewritten .pagespeed. urls? If so, you may need to apply a ModPagespeedMapRewriteDomain line to correct that.

Otto

On Sat, May 6, 2017 at 4:09 AM Rafael El Mago <rafaelm...@gmail.com> wrote:
Guys,

I am runnning NGINX on 443 (Proxy Pass), to terminate Varnish Cache. I set the Proto header and SSL On in NGINX config. 

I have Varnish on 80 & Apache with Google PageSpeed Module on 8080.

My SSL domains with Google PageSpeed load very slowwwwww...

I set ModPagespeedRespectXForwardedProto on


My questions is about configuring GPS


1) Do I have to enable or disable Fetch Https?

ModPagespeedFetchHttps enable  or disable


2) Which below do I use to properly authorize a domain or is it both?

ModPagespeedDomain https://www.example.com
ModPagespeedMapOriginDomain http://localhost https://www.example.com


3)Any other PageSpeed config that I am missing?

Rafael

--
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.
Reply all
Reply to author
Forward
0 new messages