apache / incubator-pagespeed-ngx

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

ngx_pagespeed_beacon #491

Open ali3nado opened 11 years ago

ali3nado commented 11 years ago

Failed to load resource: the server responded with a status of 500 (Internal Server Error),

how can I solve this?

jeffkaufman commented 11 years ago

If you look in the error log for nginx you should see more details on the error. It might be in /usr/local/nginx/logs/error.log.

ali3nado commented 11 years ago

There are no errors in the log file.

=/

oschaaf commented 11 years ago

@ali3nado Would you be able to post the request and response headers of a failed request?

jackbit commented 10 years ago

The same thing is happened to me:

500 Internal Server Error
nginx

here is in browser console:

POST http://mydomain/ngx_pagespeed_beacon?url=http%3A%2F%2Fmydomain%2Fmanage%2Fsermons%2Fupload 
500 (Internal Server Error) upload:199
I.(anonymous function).i upload:199
I.(anonymous function).k upload:199
(anonymous function)

and i have no idea, why this javascript is added before close body tag < / body>

http://pastie.org/private/n2xlsfrbvkqhzwxz1vpyq

jeffkaufman commented 10 years ago

i have no idea why this javascript is added before close body tag

PageSpeed inserts javascript to send back beacons so it can learn which images tend to be visible "above the fold" in the user's browser. This is the "Critical Images Beacon".

If it's giving you trouble you can disable the beacon with:

pagespeed CriticalImagesBeaconEnabled false;

Is there anything in your server's error log about why the beacon is failing? It should not be giving 500s!

cbiggins commented 8 years ago

Just had an issue with ajax file uploads on my site, it was throwing 500 errors but nothing was logged. I stumbled across this issue, changed the CriticalImagesBeaconEnabled to false and all is working again.

Does this mean that lazy loading will be affected by disabling this function?

crowell commented 8 years ago

@cbiggins If you disable image beacons but enable filters that use them, the filters will work but not as well as when beacons are enabled.

https://developers.google.com/speed/pagespeed/module/config_filters#beacons

cbiggins commented 8 years ago

Thats good info, thanks @crowell. I'm bummed about disabling it but as my site is a forum, image uploads are pretty important and a necessity. :(

jmarantz commented 8 years ago

See https://github.com/pagespeed/ngx_pagespeed/issues/1175

This seems related. Also, a candidate fix: https://github.com/pagespeed/ngx_pagespeed/pull/1177

Not 100% sure if this is the same thing yet.

On Mon, Apr 11, 2016 at 10:13 PM, Christian Biggins < notifications@github.com> wrote:

Thats good info, thanks @crowell https://github.com/crowell. I'm bummed about disabling it but as my site is a forum, image uploads are pretty important and a necessity. :(

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub https://github.com/pagespeed/ngx_pagespeed/issues/491#issuecomment-208664753

crowell commented 8 years ago

@cbiggins what version of nginx are you running?

cbiggins commented 8 years ago

@crowell 1.9.2.

crowell commented 8 years ago

so doesn't look like this is #1175 , that was introduced in nginx 1.9.14

cbiggins commented 8 years ago

Ah ok. Thanks anyway @crowell

oschaaf commented 8 years ago

@cbiggins did the 500 errors start showing up right away? Or only after the server had been running for a while?

cbiggins commented 8 years ago

Hi @oschaaf, hmmm, I'm not sure. My members reported the problem after a day or two, maybe it was running for a while.