incubator-pagespeed-ngx
incubator-pagespeed-ngx copied to clipboard
stats_json returns 404 unless an actual file is put in place on its path
An issue was reported on ngx-pagespeed-discuss that describes stats_json responding with a 404, which can be resolved by putting a file named stats_json in the corresponding directory on the filesystem:
The report, including a configuration that may reproduce this was posted here:
https://groups.google.com/forum/#!msg/mod-pagespeed-discuss/9RG-f8F8yWg/x5Qpcg7OAAAJ
Same for me, Nginx with proxy_pass proxies requests to backend:
$ fgrep stats_json /var/log/apache2/ -r | tail -1
/var/log/apache2/error.log:2020/09/14 19:41:00 [error] 28066#28066: *9111 open() "/etc/nginx/html/ngx_pagespeed_global_statistics/stats_json" failed (2: No such file or directory), client: 127.0.0.1, server: example.com, request: "GET /ngx_pagespeed_global_statistics/stats_json HTTP/1.1", host: "example.com"
To fix I had to:
$ mkdir -p /etc/nginx/html/ngx_pagespeed{,_global}_statistics
$ touch /etc/nginx/html/ngx_pagespeed{,_global}_statistics/stats_json