LoadFromFile being ignored

205 views
Skip to first unread message

sh...@salonguru.net

unread,
May 22, 2018, 11:40:17 AM5/22/18
to ngx-pagespeed-discuss

Looking for some assistance. I am trying to add the direvctive LoadFromFile but regardless where I put it inside the configuration, it appears to be being ignored.

I have followed instructions from here:

The specific configuration I have looks like this:

server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name testsalon.co.uk;
  ssl on;
  ssl_certificate /****/letsencrypt/config/live/testsalon.co.uk/fullchain.pem;
  ssl_certificate_key /****/letsencrypt/config/live/testsalon.co.uk/privkey.pem;

  
  
    #LOAD FROM FILE
  pagespeed LoadFromFile https://testsalon.co.uk/wp-content /****/wwwroot/****/wp-content1;
  pagespeed LoadFromFile https://testsalon.co.uk/files /****/wwwroot/****/wp-content1;
  pagespeed LoadFromFileRuleMatch allow ".*";
  pagespeed LoadFromFileRuleMatch disallow "\.php$ps_dollar";

  include /****/nginx/config/common.ca.conf;

}


I am using a testing server and intentionally set the path to /wp-content1 in order to generate 404's. I have hidden the dir paths for security as this is a public forum.

Within the common.ca.conf file is where our more global caching and location blocks live - theirs nothing in there except for the handling of the proxy_cache and Wordpress Cookies. 

My question is this - are there any directives that conflict with LoadFromFile? I see no reason why this shouldn't work. It's quite simply ignored! All documentation I have read tells me this should work. 

Tech Specs:
nginx version: nginx/1.14.0
built by gcc 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.9)
built with OpenSSL 1.0.2l  25 May 2017

I'm unsure of the build of ngx-pagespeed but it was the latest stable available as of the 1st May this year.

Any help would be appreciated. 

Shane

Otto van der Schaaf

unread,
May 22, 2018, 4:33:29 PM5/22/18
to ngx-pagesp...@googlegroups.com
Do you have "pagespeed ProcessScriptVariables on;"?
If not, then you should probably just '$' write instead of '$ps_dollar'
As you are using blacklisting to configure LoadFromFile, I also think you don't need 
'pagespeed LoadFromFileRuleMatch allow ".*";'  (as everything is already allowed up to this point)

Otto

--
You received this message because you are subscribed to the Google Groups "ngx-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ngx-pagespeed-di...@googlegroups.com.
Visit this group at https://groups.google.com/group/ngx-pagespeed-discuss.
For more options, visit https://groups.google.com/d/optout.

sh...@salonguru.net

unread,
May 22, 2018, 5:22:39 PM5/22/18
to ngx-pagespeed-discuss
Hi Otto, thanks for your reply :)

Yes - I do have script variables switched on - which I tried just the $ i got an error message saying that it couldn't compile (if my memory is correct).

I also thought everything should be enabled initially but I have been trying everything to try and get it to work. My current config looks like this:

  pagespeed Domain https://testsalon.co.uk;  
  pagespeed LoadFromFile https://testsalon.co.uk /var/html/www/static;
  pagespeed LoadFromFileRuleMatch disallow "\.php$ps_dollar";

I again intentionally set the LoadFromFile to a directory that doesn't exist hoping for 404's - sadly no joy. I DO however see the domain auth within the config: https://testsalon.co.uk/pagespeed_global_admin/config

Thanks for taking the time to help. 
Shane :)
To unsubscribe from this group and stop receiving emails from it, send an email to ngx-pagespeed-discuss+unsub...@googlegroups.com.

sh...@salonguru.net

unread,
May 22, 2018, 7:45:08 PM5/22/18
to ngx-pagespeed-discuss
Hi, 

Just for the avoidance of doubt, I've also been checking the apache access log (as nginx is setup to reverse proxy) and purging caches to see if pagespeed is still fetching files that should match the LoadFromFile directive via HTTP. It is.

Shane :)

Longinos

unread,
May 23, 2018, 3:43:48 AM5/23/18
to ngx-pagespeed-discuss
I am not sure if this matter, but in the docs the param for the LoadFromFile is enclosed between "".

pagespeed LoadFromFile "http://www.example.com/static/" "/var/www/static/";

sh...@salonguru.net

unread,
May 23, 2018, 7:20:04 AM5/23/18
to ngx-pagespeed-discuss
Hi Longinos, thank you for your reply.

Yes - although I have tried it with and without quotes. Please note further down that same page under the heading Limiting Direct Loading it shows examples of the same directive being used without quotes just to add confusion into the mix.

Neither work. 

Are there any requirements I need to know about .. for example:
  • Does the server need to be setup in a specific way for DNS lookup?
  • Do the file permissions need to be set above read only (our production servers are set with a read only wwwroot to apache & nginx)
  • Are there any other direcives that conflict with LoadFromFile - documented and/or undocumented?
Shane :)

Longinos

unread,
May 23, 2018, 12:39:00 PM5/23/18
to ngx-pagespeed-discuss
Hi
I don´t know if some directives are not compat with LoadFromFile.
In my config LoadFromFile have quotes and LoadFromFileRuleMatch don´t.
Are the files rewrited by pagespeed?
If not, try https://www.mydomain.com/?PageSpeedFilters=+debug and look at the html code for debug messages.
Are the resources served by apache and proxied by nginx?
In my case I have only ngix, not proxy stuff.

Otto van der Schaaf

unread,
May 23, 2018, 1:35:45 PM5/23/18
to ngx-pagesp...@googlegroups.com
Maybe it is worth tracing system calls originating from nginx to see if attempts are 
made to open the files covered by LoadFromFileXXX configuration of the module.
(And subsequently if those attempts are denied/blocked)

Otto 

To unsubscribe from this group and stop receiving emails from it, send an email to ngx-pagespeed-di...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "ngx-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ngx-pagespeed-di...@googlegroups.com.

sh...@salonguru.net

unread,
May 23, 2018, 3:06:47 PM5/23/18
to ngx-pagespeed-discuss
Thanks for your replies.

Can you give me an idea how to do that? Not sure how to debug system calls in that way.

Otto van der Schaaf

unread,
May 23, 2018, 3:44:42 PM5/23/18
to ngx-pagesp...@googlegroups.com

In any case, strace may work. first you have to figure out the pid of the nginx worker process that you want to trace.
you can pass the process id to strace via -p.
A simple example:

130 oschaaf@nps-gzip-issue-1556:~/incubator-pagespeed-ngx/testing-dependencies/mod_pagespeed/net/instaweb/rewriter⟫ sudo strace -p 6935 -y 2>&1 | grep css
recvfrom(13<socket:[5326977]>, "GET /A.store.css+vendor.css,Mcc."..., 1024, 0, NULL, NULL) = 165
open("/var/ngx_pagespeed_cache/v3/localhost/http,3A/,2Flocalhost/A.store.css+vendor.css,2CMcc.00EaqUIgkT.css.pagespeed.cf.tuzrpz_-Py.css,", O_RDONLY) = -1 ENOENT (No such file or directory)
recvfrom(13<socket:[5326985]>, "GET /A.store.css+vendor.css,Mcc."..., 1024, 0, NULL, NULL) = 165
open("/var/ngx_pagespeed_cache/v3/localhost/http,3A/,2Flocalhost/A.store.css+vendor.css,2CMcc.00EaqUIgkT.css.pagespeed.cf.tuzrpz_-Py.css,", O_RDONLY) = -1 ENOENT (No such file or directory)

In your case I would grep for the path covered by LoadFromFile 

Otto



On Wed, May 23, 2018 at 9:06 PM <sh...@salonguru.net> wrote:
Thanks for your replies.

Can you give me an idea how to do that? Not sure how to debug system calls in that way.

sh...@salonguru.net

unread,
May 24, 2018, 6:01:03 AM5/24/18
to ngx-pagespeed-discuss
Hi Otto, 

Thanks for the instructions and for bearing with my - I have never needed to do a stack trace before so your info was very helpful. 

After running the trace on all Nginx processes by running this command:

sudo strace $(pidof nginx |sed 's/\([0-9]*\)/\-p \1/g') -y 2>&1 | grep /var/html/www/static

There were NO results. 

However if I updated the command to this (made the trace higher up the file structure):

sudo strace $(pidof nginx |sed 's/\([0-9]*\)/\-p \1/g') -y 2>&1 | grep /var/html/

When i loaded a page I got the following results:
ubuntu@ip-172-31-36-110:~$ sudo strace $(pidof nginx |sed 's/\([0-9]*\)/\-p \1/g') -y 2>&1 | grep /html/
[pid 30241] open("/var/html/conf/pagespeed/cache/cache.purge", O_RDONLY) = 14</var/html/conf/pagespeed/cache/cache.purge>
[pid 30241] fstat(14</var/html/conf/pagespeed/cache/cache.purge>, {st_mode=S_IFREG|0600, st_size=14, ...}) = 0
[pid 30241] fstat(14</var/html/conf/pagespeed/cache/cache.purge>, {st_mode=S_IFREG|0600, st_size=14, ...}) = 0
[pid 30241] read(14</var/html/conf/pagespeed/cache/cache.purge>, "1527011654457\n", 4096) = 14
[pid 30241] close(14</var/html/conf/pagespeed/cache/cache.purge>) = 0
[pid 30241] write(4</var/html/conf/nginx/logs/access.log>, "{ \"time_local\": \"24/May/2018:10:"..., 385) = 385
[pid 30241] write(4</var/html/conf/nginx/logs/access.log>, "{ \"time_local\": \"24/May/2018:10:"..., 416) = 416
[pid 30238] open("/var/html/conf/pagespeed/cache/cache.purge", O_RDONLY) = 22</var/html/conf/pagespeed/cache/cache.purge>
[pid 30238] fstat(22</var/html/conf/pagespeed/cache/cache.purge>, {st_mode=S_IFREG|0600, st_size=14, ...}) = 0
[pid 30238] fstat(22</var/html/conf/pagespeed/cache/cache.purge>, {st_mode=S_IFREG|0600, st_size=14, ...}) = 0
[pid 30238] read(22</var/html/conf/pagespeed/cache/cache.purge>, "1527011654457\n", 4096) = 14
[pid 30238] close(22</var/html/conf/pagespeed/cache/cache.purge>) = 0
[pid 30238] write(4</var/html/conf/nginx/logs/access.log>, "{ \"time_local\": \"24/May/2018:10:"..., 339) = 339
.......................

So this tells me the trace was working - however Nginx made no attempt to to load from file whatsoever.

Shane :)

To unsubscribe from this group and stop receiving emails from it, send an email to ngx-pagespeed-discuss+unsub...@googlegroups.com.

sh...@salonguru.net

unread,
May 24, 2018, 6:18:15 AM5/24/18
to ngx-pagespeed-discuss
Just for the avoidance of doubt I have also repeated the test with the syntax of the directive with and without quotes. This directive is in a server block. 

pagespeed LoadFromFile "https://testsalon.co.uk/" "/var/html/www/static/";

This had no effect on the stack trace results. No attempt was made to pull from disk. 

Shane :)

sh...@salonguru.net

unread,
May 24, 2018, 6:09:23 PM5/24/18
to ngx-pagespeed-discuss
Hi everyone, 

Right I have taken the drastic step in a last ditch attempt for success to reduce the Nginx configuration to the absolute bare bones. Additionally I ran the site with and without HTTPS and ran it using basic HTML (no nginx proxy) in case it's that.. still no joy. 

I believe I have now gone above and beyond whats reasonable in terms of testing. I have spent hours on this now and the only conclusion I can draw based on my comparatively limited knowledge of ngx_pagespeed is that the directive LoadFromFile is completely and utterly f***ed. It does not work in any form whatsoever!

This is the sum total of my Nginx/pagespeed configuration as it's running now.

http {
pagespeed FileCachePath "/var/html/conf/pagespeed/cache/"; 


server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name testsalon.co.uk;
  ssl on;
  ssl_certificate /var/html/conf/letsencrypt/config/live/testsalon.co.uk/fullchain.pem;
  ssl_certificate_key /var/html/conf/letsencrypt/config/live/testsalon.co.uk/privkey.pem;

  pagespeed on;
  pagespeed LoadFromFile "https://testsalon.com/files/" "/var/www/files/";
  pagespeed EnableFilters debug;
  pagespeed RewriteLevel PassThrough;
  
  proxy_pass_header Set-Cookie;
  proxy_set_header Host $http_host:80;
  location /ngx_pagespeed_statistics { }
  location /ngx_pagespeed_global_statistics { }
  location /ngx_pagespeed_message { }
  location /pagespeed_console { }
  location ~ ^/pagespeed_admin { }
  location ~ ^/pagespeed_global_admin { }
  location ~* "^/ngx_pagespeed_beacon$" { }
  location ~* "^/pagespeed_static/" { }

  location / {
    proxy_pass http://localhost:8080;
  }

}


}

If anyone has any helpful suggestions on how to move forward with this please let me know. I am happy to provide further information for the purposes of a creating a bug report as required.

Not a very happy Shane :(

Longinos

unread,
May 25, 2018, 4:55:46 AM5/25/18
to ngx-pagespeed-discuss
Hi
and I see that:
Filters:

db Debug

hw Flushes html



Options:

AvoidRenamingIntrospectiveJavascript (aris) True

EnableCachePurge (euci) True

EnableRewriting (e) 1

FileCacheInodeLimit (afcl) 500000

RewriteLevel (l) Pass Through

No filters are enabled, only the debug. If you use Pass Through, filters must be configured one by one.
No https://testsalon.com/files/ url´s are used, no no files from disk are used.
As a test, use pagespeed RewriteLevel Corefilters;
and
pagespeed LoadFromFile "https://testsalon.co.uk/" "/var/www/";
pagespeed LoadFromFileRuleMatch disallow .*;
pagespeed LoadFromFileRuleMatch allow \.(js|css|jpg|jpeg|png|pdf|gif)(\?.*)?$;

I asume that your root dir is /var/www/





sh...@salonguru.net

unread,
May 25, 2018, 5:17:44 AM5/25/18
to ngx-pagespeed-discuss
Hi Longinos, 

Yes I painstakingly switched off all filters one block at a time, re-testing as I went until i reached the point where I had no filters or settings enabled at all. The state you saw was the last point where I stopped testing. 

I have re-enabled those filters as you have suggested and corrected the LoadFromFile to the correct paths with how I intended it to work...

pagespeed FileCachePath "/var/html/conf/pagespeed/cache/"; 
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name testsalon.co.uk;
  ssl on;
  ssl_certificate /var/html/conf/letsencrypt/config/live/testsalon.co.uk/fullchain.pem;
  ssl_certificate_key /var/html/conf/letsencrypt/config/live/testsalon.co.uk/privkey.pem;

  pagespeed on;
  pagespeed LoadFromFile "https://testsalon.co.uk/files/" "/var/html/wwwroot/salonguru/wp-content/blogs.dir/138/files/";
  pagespeed LoadFromFile "https://testsalon.co.uk/wp-content/" "/var/html/wwwroot/salonguru/wp-content/";
  pagespeed LoadFromFileRuleMatch disallow .*;
  pagespeed LoadFromFileRuleMatch allow \.(js|css|jpg|jpeg|png|pdf|gif)(\?.*)?$;
  
  proxy_pass_header Set-Cookie;
  proxy_set_header Host $http_host:80;
  location /ngx_pagespeed_statistics { }
  location /ngx_pagespeed_global_statistics { }
  location /ngx_pagespeed_message { }
  location /pagespeed_console { }
  location ~ ^/pagespeed_admin { }
  location ~ ^/pagespeed_global_admin { }
  location ~* "^/ngx_pagespeed_beacon$" { }
  location ~* "^/pagespeed_static/" { }

  location / {
    proxy_pass http://localhost:8080;
  }

}

Note the /files/. This should match all of the sites media files including the test salon logo in the top left. The /wp-content/ should pickup all the scripts/css etc from the wp-content directory which contains the theme and plugins. 

The correct path to a CSS (URL): https://testsalon.co.uk/wp-content/plugins/SG-common-files/css/common-sg.css. The actual file path is: /var/html/wwwroot/salonguru/wp-content/plugins/..etc...etc so this should be OK. 

I run the test again but sadly, it's still not attempting to pull anything from disk. Serf still completing a HTTP fetch for all resources.

Shane :)

Longinos

unread,
May 25, 2018, 5:38:03 AM5/25/18
to ngx-pagespeed-discuss
Hi
You see the pagespeed user agent in the logs?
Can you test in the https://site/pagespeed_global_admin/cache#show_metadata some rource url to see if is "file based"?

sh...@salonguru.net

unread,
May 25, 2018, 5:45:54 AM5/25/18
to ngx-pagespeed-discuss
Oh .. we are getting somewhere ...

I have enabled switched on all the statisics logging back on and went to: https://testsalon.co.uk/pagespeed_global_admin/cache#show_metadata. Then I added the following URL which is the logo: https://testsalon.co.uk/pagespeed_global_admin/cache#show_metadata

This was the result:

Metadata cache key:rname/aj_lrMnZr0pTnLVQ25f6WQk/https://testsalon.co.uk/files/TEST-SALON-1.jpg@@_
cache_ok
:true
can_revalidate
:false
partitions
:partition {
  optimizable
: false
  input
{
    index
: 0
    type
: FILE_BASED
    last_modified_time_ms
: 1519053230000
    filename
: "/var/html/wwwroot/salonguru/wp-content/blogs.dir/138/files/TEST-SALON-1.jpg"
 
}
}
other_dependency
{
  type
: FILE_BASED
  last_modified_time_ms
: 1519053230000
  filename
: "/var/html/wwwroot/salonguru/wp-content/blogs.dir/138/files/TEST-SALON-1.jpg"
}
debug_message
: "Image https://testsalon.co.uk/files/TEST-SALON-1.jpg does not appear to need resizing."

So what does this mean?

Shane :)

sh...@salonguru.net

unread,
May 25, 2018, 5:47:49 AM5/25/18
to ngx-pagespeed-discuss
Sorry this was the URL for the logo: https://testsalon.co.uk/files/TEST-SALON-1.jpg

Shane :)

sh...@salonguru.net

unread,
May 25, 2018, 6:03:37 AM5/25/18
to ngx-pagespeed-discuss
Interestingly I DO NOT see any references to these files within the appache access log. 

I only see fetches for things like the favicon and items outside of /wp-content, /files - things like /wp-includes. This is what I was expecting :)

I think it's working! Horray!

Shane :)

sh...@salonguru.net

unread,
May 25, 2018, 6:15:25 AM5/25/18
to ngx-pagespeed-discuss
So, 

Do you think one of these changes has made a difference or do you think it could have been working all along and I have been running the wrong tests?

Shane :)

Longinos

unread,
May 26, 2018, 4:52:31 AM5/26/18
to ngx-pagespeed-discuss
Hi
I think is working since you changed the paths in the LoadFromFile directive.
Why you don´t load all static resources from disc?

sh...@salonguru.net

unread,
May 28, 2018, 4:56:26 PM5/28/18
to ngx-pagespeed-discuss
Hi, 

Well that's the aim; ideally I would like nothing that static to be proxied at all. BUT i have bad news guys! I have spent some time moving this code over to one of our production servers and I'm afraid to say that I have hit this bloody issue again :( 

It think there is more at play this time because when I ran "Show metadata Cache", no matter what URL I put in there, even resources that are active in cache, I always see:

cache_ok:false
can_revalidate
:false
partitions
:

I can confirm pagespeed is operating normally and all the usual resources are optimised. When I run the strace, I see Apache pulling all the images etc from disk - not Nginx.

I really don't want to go into too much depth on a public forum with our production servers (hundreds of sites). Can I contact one of you directly?? There must be a way forward with this. 

Shane :(

sh...@salonguru.net

unread,
May 28, 2018, 6:41:28 PM5/28/18
to ngx-pagespeed-discuss
Not sure if there is something amiss with the caches on the production server? Could this cause the issue (in yellow)?

Shared memory metadata cache 'pagespeed_default_shm' statistics:
Total put operations: 7612505
  updating an existing key
: 512
  replace
/conflict miss: 238
  simultaneous same
-key insert: 0
  dropped since all of associativity
set locked: 0
  spinning sleeps performed
by writers: 0
Total get operations: 36626
  hits
: 9518 (25.99%)
Entries used: 7590310 (26.01%)
Blocks used: 58348417 (99.99%)

Just a shot in the dark as I'm out of ideas. 

Shane :)

Joshua Marantz

unread,
May 28, 2018, 11:25:22 PM5/28/18
to ngx-pagesp...@googlegroups.com
Hi Shane -- with all the caches running around at various levels in the stack, it can be hard to sort out what's going on.  At a high level, I think it might be easiest to detect that LoadFromFile is working by looking at the stats serf_fetch_request_count. If you purge the cache completely, and fetch your page, you probably would see dozens of new requests added to that stat.  If you've successfully gotten all the resources loaded from file, you shouldn't see any.

Note that ngx_pagespeed will not instantly optimize all assets. To avoid making the first site visitor pay for all the optimizations with a lot of latency, the site is delivered unoptimized to the first viewer and then optimized in the background.  This means that the requests to the origin files will probably fall through to the origin server, so you'll see Apache try to fetch those files. That doesn't mean that ngx_pagespeed is failing to also load them from disk.

Of course strace probably doesn't lie, but I would imagine that output is very hard to read given that nginx has multiple child subprocesses. That's why I'd start by looking at stats. I wish we had a stat counting the LoadFromFile matches, but it appears we don't.

RE shm-cache stats; I don't think this is a likely culprit, but you can try bumping up the size of the shm-cache.


--
You received this message because you are subscribed to the Google Groups "ngx-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ngx-pagespeed-di...@googlegroups.com.

sh...@salonguru.net

unread,
May 29, 2018, 5:56:22 AM5/29/18
to ngx-pagespeed-discuss
Hi Joshua, 

Thank you for your reply - I do indeed see a count in the tens of thousands under the stat "serf_fetch_request_count" - this confirms what I see with stack trace. LoadFromFile is again not working. 

I know Pagespeed doesn't instantly optimise - I am familiar with how it works. I have repeatedly purged caches but as there are more than 130 websites on this particular server, I am always hesitant to do that because it puts the server under substantial load until the cache recovers.

In my honest opinion I have become rather annoyed with this whole thing. I don't understand why it "suddenly" started working on the test server, it wont work at all on our production server. According to the documentation, It should 404 resources that it can't find on disk - it simply doesn't. On the test server, I worked backwards and re-enabled all of the settings and files I commented out and now I can't stop it from working! The test server was built using an old backup so the setup is more or less identical to production. This MUST be bug because there appears to be NO logical reason why this should not be working.

Any ideas?

PD: I would bump up the shm-cache size but it's already at 5GB - a third of the servers entire RAM memory. 

Shane :)
To unsubscribe from this group and stop receiving emails from it, send an email to ngx-pagespeed-discuss+unsub...@googlegroups.com.

Otto van der Schaaf

unread,
May 29, 2018, 7:21:02 AM5/29/18
to ngx-pagesp...@googlegroups.com
Is is possible to post the full configuration with the sensitive bits stripped out?
Also, you mentioned using the ProcessScriptVariables feature earlier. 
I'm curious in which pagespeed directives you need variables to be expanded? 

To unsubscribe from this group and stop receiving emails from it, send an email to ngx-pagespeed-di...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "ngx-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ngx-pagespeed-di...@googlegroups.com.

Otto van der Schaaf

unread,
May 29, 2018, 7:40:05 AM5/29/18
to ngx-pagesp...@googlegroups.com

sh...@salonguru.net

unread,
May 29, 2018, 8:05:15 AM5/29/18
to ngx-pagespeed-discuss
Hi Otto, 

I can post my full config if that is helpful although it's quite lengthy. I also wondered about the post script variables and after checking my code, I believe it was once used for helping Nginx and pagespeed detimin if the user was logged into wordpress. If my memory is correct I used post variables to pass the values of wordpress cookies through to switch certain features on or off. Happily the code had been simplified so was no longer being used. Post variable is now switched off without creating any futher issues.

Humm .. interesting - were on the same version. Although both my testing and production servers are both on pagespeed: 1.13.35.2-0. One works, one doesn't, The only "OS" difference was on the test server, pagespeed was compiled using Nginx: 1.13.9 and production is on: 1.14.0.

Shane :)

To unsubscribe from this group and stop receiving emails from it, send an email to ngx-pagespeed-discuss+unsub...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "ngx-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ngx-pagespeed-discuss+unsub...@googlegroups.com.

Joshua Marantz

unread,
May 29, 2018, 8:39:33 AM5/29/18
to ngx-pagesp...@googlegroups.com
I wouldn't rule out a bug, but there are tests that get run with every commit and every release, covering all aspects of functionality (or at least that was the goal).  There could be a corner-case you are hitting we might not have anticipated, though...it might be worth exploring what's different about your setup vs (say) the tests defined in these files:
https://github.com/apache/incubator-pagespeed-mod/blob/master/install/debug.conf.template#L464

But one thing to double-check: is the full URL prefix you are supplying to LoadFromFile match exactly the URLs as seen by the server? I have seen situations with multi-tiered setups where a proxy might have a different view of the URL origin, e.g. it might be on a port or something.

To unsubscribe from this group and stop receiving emails from it, send an email to ngx-pagespeed-di...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "ngx-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ngx-pagespeed-di...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "ngx-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ngx-pagespeed-di...@googlegroups.com.

Otto van der Schaaf

unread,
May 29, 2018, 9:01:18 AM5/29/18
to ngx-pagesp...@googlegroups.com
I just ran the tests for ngx_pagespeed and they are passing on ngx_pagespeed's master with both nginx/1.13.4 and nginx's head of master (1.15.x).

That makes me think a bug is unlikely, but maybe something happened with nginx..
Or, as Josh stated, maybe we are missing a corner case in test coverage.


Otto van der Schaaf

unread,
May 29, 2018, 9:04:12 AM5/29/18
to ngx-pagesp...@googlegroups.com
" but maybe something happened with nginx."  
Sorry - that was a confusing line. Later nginx versions introducing an issue with LoadFromFile seems pretty much ruled out I think.

sh...@salonguru.net

unread,
May 29, 2018, 9:37:46 AM5/29/18
to ngx-pagespeed-discuss
Well, I'd thought if it's a corner case in testing, you should be able to replicate the issue quite quickly your end?

If you can't replicate it then I'll post up my full config for you to examine. 

Shane :)
To unsubscribe from this group and stop receiving emails from it, send an email to ngx-pagespeed-discuss+unsub...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "ngx-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ngx-pagespeed-discuss+unsub...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "ngx-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ngx-pagespeed-discuss+unsub...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "ngx-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ngx-pagespeed-discuss+unsub...@googlegroups.com.

Otto van der Schaaf

unread,
May 29, 2018, 9:59:16 AM5/29/18
to ngx-pagesp...@googlegroups.com
Well the thing is that the system tests I ran earlier on multiple nginx versions cover all the cases that we could think of up front.

So replicating your issue quickly without knowing all the details of the configuration
may be surprisingly hard.

Otto


To unsubscribe from this group and stop receiving emails from it, send an email to ngx-pagespeed-di...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "ngx-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ngx-pagespeed-di...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "ngx-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ngx-pagespeed-di...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "ngx-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ngx-pagespeed-di...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "ngx-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ngx-pagespeed-di...@googlegroups.com.

sh...@salonguru.net

unread,
May 29, 2018, 10:29:16 AM5/29/18
to ngx-pagespeed-discuss
OK I understand that - here comes my full config :) Feel like I'm giving away my lifes work!

So to begin with, /etc/nginx/nginx.conf isn't used - this is for permissions reasons. Nginx.conf includes a file called setup.conf. The rough contents of that file is below. At the bottom you'll see another include that is for the moved sites-enabled folder (i stole the wording from Apache!). This contains the config of all of the sites - one file per site. I've added an example of one of those. Finally within the main SSL server block, it references another file, common.ca.conf - this contains alll the caching and location blocks. We did it this way so that we can automate the process of adding and removing sites to the system while being able to keep the config global. 

So the first file: setup.conf (Nginx/Pagespeed's Main config):

####### GENERAL NGINX CONFIGURATION #########

events {
worker_connections 1024;
multi_accept on;
use epoll;
}

http {
# General Settings
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
server_tokens off;
reset_timedout_connection on;
server_names_hash_bucket_size 1024;
server_name_in_redirect on;
# Logging. Log formats can only be set for access logs. 
log_format sgjson escape=json '{ "time_local": "$time_local", '
'"remote_addr": "$remote_addr", '
'"remote_user": "$remote_user", '
'"domain": "$host", '
'"request": "$request", '
'"status": "$status", '
'"body_bytes_sent": "$body_bytes_sent", '
'"request_time": "$request_time", '
'"http_referrer": "$http_referer", '
'"http_user_agent": "$http_user_agent" }';

access_log ***/access.log sgjson;
error_log ***/error.log;
# Timeouts & General - OLD 3000 ?? / SECONDS
client_max_body_size 20m;
  proxy_connect_timeout 120;
  proxy_send_timeout 120;
  proxy_read_timeout 120;
  send_timeout 120;
  client_header_timeout 120;
client_body_timeout 120;

include /etc/nginx/mime.types;
default_type text/html;

# SSL Settings
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
ssl_prefer_server_ciphers on;

#Define backend
upstream backend {
#ip_hash;
}
map $http_x_forwarded_proto $thescheme {
default $scheme;
https https;
}
#STATIC EXPIRES MAPPING
map $sent_http_content_type $expires {
default off;
text/html eposh;
text/css max;
application/javascript max;
~image/ max;
image/png max;
image/jpg max;
}
#GENERAL
  #pagespeed ProcessScriptVariables off;
pagespeed ImageMaxRewritesAtOnce 150;
# pagespeed RateLimitBackgroundFetches off;
pagespeed InPlaceResourceOptimization on;
  pagespeed XHeaderValue "Powered by Salon Guru LTD";
  # pagespeed FetchHttps enable; //not required
  pagespeed FetchWithGzip on;
  pagespeed LogDir /***pagespeed/logs/;
#MAP EXTERNAL RESOURCES
# pagespeed DangerPermitFetchFromUnknownHosts on;
pagespeed MapProxyDomain https://***.salonguru.net/latedeals https://latedeals.***.co/;
        .........
        .........
        ......... (there are many of these that ive removed ..........
 
#CACHING
pagespeed EnableCachePurge on;
proxy_cache_path /var/html/conf/nginx/cache levels=1:2 keys_zone=SGProduction:1000m inactive=168h max_size=20g;
pagespeed FileCachePath "/var/html/conf/pagespeed/cache/";
#pagespeed DefaultSharedMemoryCacheKB 7340032; #7gb
pagespeed DefaultSharedMemoryCacheKB 5242880; #5gb
#pagespeed DefaultSharedMemoryCacheKB 2621440; #2.5gb
#pagespeed FileCacheSizeKb 31457280; #30gb
pagespeed FileCacheSizeKb 26214400; #25gb
#pagespeed FileCacheSizeKb 20971520; #20gb
#pagespeed FileCacheSizeKb 15728640; #15gb
pagespeed ShmMetadataCacheCheckpointIntervalSec 300;
  pagespeed ForceCaching on;
  #pagespeed ImplicitCacheTtlMs 604800000; # 1 week
  
  #LOAD FROM FILE CONFIGURATION
pagespeed LoadFromFileRuleMatch disallow .*;
pagespeed LoadFromFileRuleMatch allow \.(js|css|jpg|jpeg|png|pdf|gif)(\?.*)?\$;
  
  #LOGGING
  pagespeed StatisticsLogging on;
  pagespeed StatisticsLoggingIntervalMs 60000;
  pagespeed StatisticsLoggingMaxFileSizeKb 102400;
  pagespeed MessageBufferSize 2048000;
#HANDLERS
pagespeed StatisticsPath /ngx_pagespeed_statistics;
  pagespeed GlobalStatisticsPath /ngx_pagespeed_global_statistics;
  pagespeed MessagesPath /ngx_pagespeed_message;
  pagespeed ConsolePath /pagespeed_console;
  pagespeed AdminPath /pagespeed_admin;
  pagespeed GlobalAdminPath /pagespeed_global_admin;
  
  pagespeed StatisticsDomains Allow ***.salonguru.net
  pagespeed GlobalStatisticsDomains Allow ***.salonguru.net;
  pagespeed MessagesDomains Allow ***.salonguru.net;
  pagespeed ConsoleDomains Allow ***.salonguru.net;
  pagespeed AdminDomains Allow ***.salonguru.net;
  pagespeed GlobalAdminDomains Allow ***.salonguru.net;
   
  #FILTERS
  pagespeed EnableFilters extend_cache;
pagespeed EnableFilters prioritize_critical_css,fallback_rewrite_css_urls,combine_css;
pagespeed PermitIdsForCssCombining style*;
pagespeed EnableFilters rewrite_javascript,defer_javascript;
pagespeed EnableFilters collapse_whitespace;
pagespeed EnableFilters inline_google_font_css;
# pagespeed EnableFilters make_google_analytics_async;

#lazyload_images - causes issue?
pagespeed EnableFilters rewrite_images,responsive_images,jpeg_subsampling,inline_images,convert_jpeg_to_progressive;
pagespeed NoTransformOptimizedImages on;
 
#SYSTEM SERVER BLOCKS
server {
listen 80 default_server;
listen [::]:80 default_server;
return 301 https://$host$request_uri;
}
server {
listen 443 default_server;
listen [::]:443 default_server;
ssl on;
  ssl_certificate ***/fullchain.pem;
  ssl_certificate_key ***/privkey.pem;
 
#Default Location - catch if site doesn't exist
error_page 404 403 /index.php;
location / {
allow all;
pagespeed standby;
root ***/public/;
}
#Let's Encrypt
location ~ /.well-known {
  allow all;
  pagespeed standby;
  root /***/salonguru/;
  }
 
}


#Include SG configs
#include ***/conf.d/*.conf;
include ***/sites-enabled/*;
}



At this point, Nginx includes everything within sites-enabled. There are 130+ config files (one for each site). These are dynamically written to disk via a custom Wordpress plugin. They don't contain much of importance so I've included one as an example so you can see the flow ...


server {
listen 80;
listen [::]:80;
return 301 https://testsalon.co.uk$request_uri;
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
  server_name www.testsalon.co.uk;
  ssl on;
  ssl_certificate /***/live/testsalon.co.uk/fullchain.pem;
  ssl_certificate_key /***/live/testsalon.co.uk/privkey.pem;
  
  return 301 https://testsalon.co.uk$request_uri;
  
}

server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name testsalon.co.uk;
  ssl on;
  ssl_certificate /***/live/testsalon.co.uk/fullchain.pem;
  ssl_certificate_key /***/live/testsalon.co.uk/privkey.pem;

  include /var/html/conf/nginx/config/common.ca.conf;
  
}


At the bottom you see it references a file called common.ca.conf. This is our reference to a common cache file that has all the location blocks and settings for proxy cache and pagespeed caching:

# pagespeed handlers & general options

pagespeed on;
set $wordpress_auth "";
location /ngx_pagespeed_statistics { }
location /ngx_pagespeed_global_statistics { }
location /ngx_pagespeed_message { }
location /pagespeed_console { }
location ~ ^/pagespeed_admin { }
location ~ ^/pagespeed_global_admin { }
location ~* "^/ngx_pagespeed_beacon$" { }
location ~* "^/pagespeed_static/" { }

# Set proxy headers for the passthrough
port_in_redirect off;
proxy_pass_header Set-Cookie;
proxy_set_header Host $http_host:80;
proxy_set_header X-Forwarded-Host $http_host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;


#### SECURITY ####
#prevents TRACE, DELETE, PUT, OPTIONS.
if ($request_method !~ ^(GET|HEAD|POST)$ ){
    return 405;
}
location ~ /(XAttacker.php|attacker|xattacker|xAttacker|Xattacker|X=Attacker) {
    deny all;
}
#X-XSS PROTECTION - To mitigate Cross-Site scripting attack
add_header X-XSS-Protection "1; mode=block";

# PREVENT CLICKJACKING
add_header X-Frame-Options "SAMEORIGIN";

##################


# DISABLE PAGESPEED / CACHES FOR THESE LOCATIONS
location ~* ^/(wp-admin|wp-login|salon-gift-vouchers|shopping-cart|gift-vouchers|YourSalon-Deals|cart|checkout|my-account|online-store|basket|shop|store|product|amp|status) {
    proxy_pass http://backend;
    pagespeed standby;
}

# DISABLE PAGESPEED FOR YOURSALON.CO FED CONTENT
location ~* ^/(yoursalon|content-only) {
    proxy_pass http://backend;
    pagespeed standby;
}

# BYPASS FOR YOURSALON QUERIES
if ($arg_ysr != "") {
    set $bypass_cache "1";
}

# DISABLE CACHES FOR ZIG ZAG MESSAGES
location ~* ^/(message) {
    proxy_pass http://backend;
    pagespeed standby;
}

# DISABLE CACHES & PAGESPEED FOR SENDY PLUGIN FILES
location ~* ^/(wp-content/uploads/browsershot) {
    proxy_pass http://backend;
    pagespeed standby;
}

# DISABLE CACHES & PAGESPEED FOR SALON GURU GDPR PAGES
location ~* ^/(dpa|wdma) {
    proxy_pass http://backend;
    pagespeed standby;
}

# REDIRECT BLOG SIGNUP PAGE
location ~* ^/(wp-signup) {
    rewrite ^/.* https://www.salonguru.net permanent;
}

# DETECT DEVICE
set $mobile_detect desktop;
if ($http_user_agent ~* "(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino") {
    set $mobile_detect mobile;
}
if ($http_user_agent ~* "^(1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-)") {
    set $mobile_detect mobile;
}

# SET CACHE KEY BASED ON DEVICE
set $cache_key $mobile_detect|$host|$request_uri|$request_body;

#BYPASS CACHE FOR OPTIMISED RESOURCES
if ($uri ~ "\.pagespeed\.([a-z]\.)?[a-z]{2}\.[^.]{10}\.[^.]+") {
    set $bypass_cache "1";
}

if ($uri ~*  "\.(jpg|jpeg|png|gif|ico|css|js|webp)") {
    set $bypass_cache "1";
}

location / {
    #Caches
    proxy_cache SGProduction;
    proxy_cache_key $cache_key;
    proxy_cache_valid 10m;
    proxy_ignore_headers Cache-Control Set-Cookie Expires;
    proxy_cache_revalidate on;
    proxy_cache_background_update on;
    proxy_cache_lock on;
    proxy_http_version 1.1;
    proxy_cache_use_stale error timeout invalid_header updating http_500 http_502 http_503 http_504;
    
    # CATCH WORDPRESS COOKIES
    if ($http_cookie ~* "wordpress_logged_in_[^=]*=([^%]+)%7C") {
        set $wordpress_auth "1";
        pagespeed standby; 
    }
    
    # REMOVE CACHE IF ON PASSWORD PROTECTED PAGE
    if ($http_cookie ~* "wp-postpass_") {
        set $wordpress_auth "1";
    }
        
    # Set headers
    add_header X-Cache-Status $upstream_cache_status;
    add_header X-Cache-Key $cache_key;
    add_header X-Cache-Device $mobile_detect;

    # Bypass for when logged into Wordpress
    proxy_cache_bypass $wordpress_auth; # Do not serve response from cache.
    proxy_no_cache $wordpress_auth;  # Do save the response to cache
    
    #Bypass for optimise resources
    proxy_cache_bypass $bypass_cache;
    proxy_no_cache $bypass_cache;
    
    # Bypass for dev tools / hard refreshes
    proxy_cache_bypass $http_pragma;
        
    # Proxy request to backend
    proxy_pass http://backend;
}

There is a common.noca.conf file - that file just has location blocks which disables pagespeed and proxy caching - I don't see the need to include that.

Finally there is an _authorised_domains.conf file that also lives within the sites-enabled directory. This is dynamically written and has all the LoadFromDisk directives for each site. As /files/ is in a different physical place on each site (by blog ID number), each one must be mapped individually. We use a plugin for this. In total there are 260 lines to this file (2 for each site) following this format:

pagespeed LoadFromFile "https://www.testsalon.co.uk/files/" "/var/html/wwwroot/salonguru/wp-content/blogs.dir/138/files/";
pagespeed LoadFromFile "https://www.testsalon.co.uk/wp-content/" "/var/html/wwwroot/salonguru/wp-content/";
pagespeed LoadFromFile "https://www.salonguru.net/files/" "/var/html/wwwroot/salonguru/wp-content/blogs.dir/150/files/";
pagespeed LoadFromFile "https://www.salonguru.net/wp-content/" "/var/html/wwwroot/salonguru/wp-content/";
........
........



Hope this is helpful - if you have any questions please let me know. 

Shane :)

To unsubscribe from this group and stop receiving emails from it, send an email to ngx-pagespeed-discuss+unsub...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "ngx-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ngx-pagespeed-discuss+unsub...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "ngx-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ngx-pagespeed-discuss+unsub...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "ngx-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ngx-pagespeed-discuss+unsub...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "ngx-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ngx-pagespeed-discuss+unsub...@googlegroups.com.

sh...@salonguru.net

unread,
Jun 4, 2018, 5:42:30 AM6/4/18
to ngx-pagespeed-discuss
Any joy on this yet?

Shane :)

Otto van der Schaaf

unread,
Jun 5, 2018, 8:40:33 AM6/5/18
to ngx-pagesp...@googlegroups.com
Sorry for the late reply. It looks like it is also not straightforward to point out what could 
prevent LoadFromFile from not matching incoming urls, or being bypassed altogether,
because there's a lot of things going on in the configuration.

I'd be inclined to build a developer version [1] of nginx/ngx_pagespeed and fire up the debugger.
Probably setting a breakpoint on net_instaweb::FileLoadPolicy::ShouldLoadFromFile
will be worth it, and I would be interested in what the value of "url" is when that 
method is called. Another option is that FileLoadPolicy::ShouldLoadFromFile isn't called
at all, in which case turning on the nginx debug logging [2] may be helpful to see if the response
actually is flowing through ngx_pagespeed.



On Mon, Jun 4, 2018 at 11:42 AM <sh...@salonguru.net> wrote:
Any joy on this yet?

Shane :)

--
You received this message because you are subscribed to the Google Groups "ngx-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ngx-pagespeed-di...@googlegroups.com.

sh...@salonguru.net

unread,
Jun 5, 2018, 9:43:18 AM6/5/18
to ngx-pagespeed-discuss
Hi Otto, 

That's OK. Thanks for your reply. 

Although I might just about have the technical skill to setup a development version of NGX and debug it, I certainly don't have the time. I just don't have the resources available to put this problem above everything else; I've spent too many hours on it already. 

So I'm afraid to say, if you guys aren't prepared to debug it or someone else with the same issue can't resolve it, then this will just have to be put to one side. 

Thanks for all your help on this. Please keep this thread updated if you do find a work around or solution.  

Shane :) 

On Tuesday, 5 June 2018 13:40:33 UTC+1, Otto van der Schaaf wrote:
Sorry for the late reply. It looks like it is also not straightforward to point out what could 
prevent LoadFromFile from not matching incoming urls, or being bypassed altogether,
because there's a lot of things going on in the configuration.

I'd be inclined to build a developer version [1] of nginx/ngx_pagespeed and fire up the debugger.
Probably setting a breakpoint on net_instaweb::FileLoadPolicy::ShouldLoadFromFile
will be worth it, and I would be interested in what the value of "url" is when that 
method is called. Another option is that FileLoadPolicy::ShouldLoadFromFile isn't called
at all, in which case turning on the nginx debug logging [2] may be helpful to see if the response
actually is flowing through ngx_pagespeed.



On Mon, Jun 4, 2018 at 11:42 AM <sh...@salonguru.net> wrote:
Any joy on this yet?

Shane :)

--
You received this message because you are subscribed to the Google Groups "ngx-pagespeed-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ngx-pagespeed-discuss+unsub...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages