incubator-pagespeed-ngx
incubator-pagespeed-ngx copied to clipboard
Error: Resource based on <image.jpg> but cannot access the original
We have an nginx as a caching proxy server in front of apache server. All the static content is served by nginx, php files are forwarded to apache.
In our message_history we are getting lots of intermittent errors of type: [xlogo-small.png:0] Resource based on https://www.hostname.com/docs/img/logo-small.png but cannot access the original
These errors occur randomly on random files (the example above is a regular static image).
Relevant nginx/pagespeed config:
location ^~ /docs/ {
try_files $uri @not_found;
expires 366d;
add_header Pragma public;
add_header Cache-Control "public";
}
location @not_found {
return 404;
}
pagespeed Domain https://*.hostname.*;
pagespeed MapOriginDomain https://127.0.0.1 https://*.hostname.*;
Thank you for your help.
Hi Almost you need to enable https fecht. pagespeed FetchHttps enable; pagespeed SslCertDirectory directory; pagespeed SslCertFile file;
@Lofesa, thank you for your hint. I did change the configuration as suggested, but at first the same problems were still present. I did turn around the whole configuration now, made it much simpler for testing purposes and I will see now, currently, 12 hours have passed without a warning so far.
I will report the working configuration.
@zevnikrok I have the exact same issue.
How did you solve it?
uf..., so much for promising to post working configuration :)
This is our production version, working acceptable ok, google still makes lots of suggestions, and it doesn't rate page really well. Keep in mind we have multiple hosts, which serve almost the same content: www.host.com, w2.host.com, www.host.eu, www.host.fr ...
pagespeed on; pagespeed Domain https://.host.; pagespeed MapOriginDomain https://www.host.com https://.host.;
pagespeed FileCachePath /var/ngx_pagespeed_cache; pagespeed ListOutstandingUrlsOnError on;
pagespeed RewriteLevel PassThrough; pagespeed EnableFilters inline_images,recompress_images,convert_to_webp_lossless,resize_rendered_image_dimensions,resize_images,responsive_images,responsive_images_zoom,lazyload_images,rewrite_css,prioritize_critical_css,combine_css,add_head,fallback_rewrite_css_urls,rewrite_css,flatten_css_imports,inline_css,rewrite_style_attributes,inline_import_to_link,convert_meta_tags,rewrite_javascript,inline_javascript; pagespeed ImagePreserveURLs on;
pagespeed Statistics on; pagespeed StatisticsLogging on; pagespeed LogDir /var/log/pagespeed; pagespeed MessageBufferSize 1000000; pagespeed EnableCachePurge on;
pagespeed FetchHttps enable,allow_unknown_certificate_authority; pagespeed SslCertDirectory /etc/pki/tls/certs; pagespeed SslCertFile /etc/pki/tls/cert.pem;
I hope it helps