apache / incubator-pagespeed-ngx

Automatic PageSpeed optimization module for Nginx
http://ngxpagespeed.com/
Apache License 2.0
4.37k stars 365 forks source link

1.JiBnMqyl6S.gif Failed to load resource: the server responded with a status of 404 (Not Found) #937

Closed vinvin27 closed 9 years ago

vinvin27 commented 9 years ago

I got this issue after activated filters on my nginx :(

Im using prestashop with url friendly :/

jeffkaufman commented 9 years ago

Is that the full error? Could you "view source" on the page, find the reference to 1.JiBnMqyl6S.gif, and paste the surrounding html here?

When you say prestashop with url friendly you mean this, right? http://doc.prestashop.com/display/PS15/System+Administrator+Guide#SystemAdministratorGuide-NginxfriendlyURLs This looks like it might interact badly with ngx_pagespeed; I'm not sure yet.

vinvin27 commented 9 years ago

Hey Jeff :)

Thanks for you reply !

yes, thats this url rewriting ! In fact, it s this one : http://pastie.org/10036442 the full error : Failed to load resource: the server responded with a status of 404 (Not Found) https://example.com/pagespeed_static/1.JiBnMqyl6S.gif

And an example where it is called :

< img width="20" pagespeed_lazy_src="/themes/buyshop/img//facebook.png"
   pagespeed_url_hash="4182883865" src="/pagespeed_static/1.JiBnMqyl6S.gif"
   onload="pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);">

but I haven't got /pagespeed_static/ on my server...

thanks

jeffkaufman commented 9 years ago

That's a tiny (1x1) gif that PageSpeed uses as a placeholder when lazyloading images. PageSpeed should handle serving it; here's an example: http://ngxpagespeed.com/pagespeed_static/1.JiBnMqyl6S.gif

Do you have this line in your config?

 location ~ "^/pagespeed_static/" { }

(From https://developers.google.com/speed/pagespeed/module/configuration)

vinvin27 commented 9 years ago

Yes I got it ! My nginx config : http://pastie.org/10036535

UPDATE : After creating and downloading the gif, no more 404 errors ;)

Thanks for you support :)

jeffkaufman commented 9 years ago

I think this is probably a bad interaction with your rewrite rules. Probably the simplest fix would be to disable lazyload_images by removing it from the list on line 105.

jeffkaufman commented 9 years ago

(Or you could try to see what rewrite rule might be catching this file under /pagespeed_static/.)

vinvin27 commented 9 years ago

Yes thanks you Jeff :)

mtx-z commented 7 years ago

For anyone having this issue (404 on the GIF file from /pagespeed_static/), i fixed it adding: pagespeed LazyloadImagesBlankUrl "https://www.gstatic.com/psa/static/1.gif"; to my config. (see https://modpagespeed.com/doc/filter-lazyload-images)