Discover Centmin Mod today
Register Now

Nginx PageSpeed Nginx Pagespeed Troubleshooting issues and errors

Discussion in 'Nginx, PHP-FPM & MariaDB MySQL' started by BamaStangGuy, May 25, 2014.

Tags:
  1. eva2000

    eva2000 Administrator Staff Member

    45,703
    10,377
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +16,103
    Local Time:
    8:35 PM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    yeah i have to fix that part :eek:
     
  2. BamaStangGuy

    BamaStangGuy Premium Member Premium Member

    651
    189
    43
    May 25, 2014
    Ratings:
    +264
    Local Time:
    4:35 AM
    I am still having this issue on another droplet:

    Code:
    [root@s1 centminmod-123.07beta21]# nprestart
    
    nginx: [emerg] unknown directive "pagespeed" in /usr/local/nginx/conf/pagespeed.conf:1
    
    nginx: configuration file /usr/local/nginx/conf/nginx.conf test failed
    
    Gracefully shutting down php-fpm . done
    
    Starting php-fpm  done
    pagespeed.conf is commented out...... and pagespeed is not compiled.
     
  3. BamaStangGuy

    BamaStangGuy Premium Member Premium Member

    651
    189
    43
    May 25, 2014
    Ratings:
    +264
    Local Time:
    4:35 AM
    Thanks for being patient with me @eva2000 :)
     
  4. eva2000

    eva2000 Administrator Staff Member

    45,703
    10,377
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +16,103
    Local Time:
    8:35 PM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    server seems to be fixed now, the problem with your nginx restart error after ngx_pagespeed was disabled on Nginx recompile (setting in centmin.sh NGINX_PAGESPEED=n before recompile Nginx via menu 4 option), is that you have a few nginx vhosts with the 3 pagespeed include lines enabled (uncommented without hash).

    The error you got

    Code:
    Starting nginx: nginx: [emerg] unknown directive "pagespeed" in /usr/local/nginx/conf/pagespeed.conf:1
                                                               [FAILED]
    If you disable ngx_pagespeed in centmin.sh with NGINX_PAGESPEED=n, then you must ensure to comment out the 3 pagespeed include lines in each Nginx vhost located at /usr/local/nginx/conf/conf.d/ (it ain't automatically done right now).

    Code:
    # ngx_pagespeed & ngx_pagespeed handler
    #include /usr/local/nginx/conf/pagespeed.conf;
    #include /usr/local/nginx/conf/pagespeedhandler.conf;
    #include /usr/local/nginx/conf/pagespeedstatslog.conf;
    
     
  5. BamaStangGuy

    BamaStangGuy Premium Member Premium Member

    651
    189
    43
    May 25, 2014
    Ratings:
    +264
    Local Time:
    4:35 AM
    Yes that was my error not taking into account the other vhosts that reside on there. Thank you for looking into it.
     
  6. eva2000

    eva2000 Administrator Staff Member

    45,703
    10,377
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +16,103
    Local Time:
    8:35 PM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    Yeah I'll see what i can do with regards to the 2 issues when Nginx is recompiled with ngx_pagespeed disabled in centmin.sh NGINX_PAGESPEED=n where

    1. the nginx.conf include file for /usr/local/nginx/conf/pagespeedadmin.conf isn't commented out automatically
    2. your issue where there's no automatic commenting out of those 3 pagespeed include lines in ALL Nginx vhosts which had previously been uncommented (pagespeed enabled) located at /usr/local/nginx/conf/conf.d/ that led to your issue
     
  7. eva2000

    eva2000 Administrator Staff Member

    45,703
    10,377
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +16,103
    Local Time:
    8:35 PM
    Nginx 1.19.x
    MariaDB 5.5/10.x
  8. BamaStangGuy

    BamaStangGuy Premium Member Premium Member

    651
    189
    43
    May 25, 2014
    Ratings:
    +264
    Local Time:
    4:35 AM
    Screen Shot 2014-05-29 at 3.13.07 AM.png

    pagespeedstatslog.conf

    # Pagespeed stats logging 1.6.29.3+

    pagespeed Statistics on;

    pagespeed StatisticsLogging on;

    pagespeed LogDir /var/log/pagespeed;

    I have restarted nginx and still get that message.
     
  9. eva2000

    eva2000 Administrator Staff Member

    45,703
    10,377
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +16,103
    Local Time:
    8:35 PM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    did you uncomment in pagespeed.conf the pagespeed MessageBufferSize option ? and restart Nginx
     
  10. BamaStangGuy

    BamaStangGuy Premium Member Premium Member

    651
    189
    43
    May 25, 2014
    Ratings:
    +264
    Local Time:
    4:35 AM
    If I go to https://www.aspiescentral.com/pagespeed_console I get 403 forbidden

    If I use my ip I get that page I attached

    If I go into virtual.conf and uncomment the pagespeed confs I get a 403 forbidden for my ip.

    This is my pagespeedhandler.conf

    Code:
    #  Ensure requests for pagespeed optimized resources go to the pagespeed
    #  handler and no extraneous headers get set.
    location ~ "\.pagespeed\.([a-z]\.)?[a-z]{2}\.[^.]{10}\.[^.]+" { add_header "" ""; }
    location ~ "^/ngx_pagespeed_static/" { }
    location ~ "^/ngx_pagespeed_beacon$" { }
    location /ngx_pagespeed_statistics { allow 127.0.0.1; allow 68.62.217.80; deny all; }
    location /ngx_pagespeed_global_statistics { allow 127.0.0.1; allow 68.62.217.80; deny all; }
    location /ngx_pagespeed_message { allow 127.0.0.1; allow 68.62.217.80; deny all; }
    location /pagespeed_console { allow 127.0.0.1; deny all; }
    location ~ ^/pagespeed_admin { allow 127.0.0.1; deny all; }
    location ~ ^/pagespeed_global_admin { allow 127.0.0.1; deny all; }
    Where the 68 ip is my isp external ip
     
  11. BamaStangGuy

    BamaStangGuy Premium Member Premium Member

    651
    189
    43
    May 25, 2014
    Ratings:
    +264
    Local Time:
    4:35 AM
    I did
     
  12. eva2000

    eva2000 Administrator Staff Member

    45,703
    10,377
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +16,103
    Local Time:
    8:35 PM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    set it for all locations including the last 3 in your list
     
  13. BamaStangGuy

    BamaStangGuy Premium Member Premium Member

    651
    189
    43
    May 25, 2014
    Ratings:
    +264
    Local Time:
    4:35 AM
    Progress but now I am just getting blank info for each tab. Did a restart and have been browsing around the forum (its fairly active so many should be hitting it)

    Screen Shot 2014-05-29 at 4.12.57 AM.png
     
  14. BamaStangGuy

    BamaStangGuy Premium Member Premium Member

    651
    189
    43
    May 25, 2014
    Ratings:
    +264
    Local Time:
    4:35 AM
    Not showing anything in the log directory:

    Screen Shot 2014-05-29 at 4.32.13 AM.png
     
  15. eva2000

    eva2000 Administrator Staff Member

    45,703
    10,377
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +16,103
    Local Time:
    8:35 PM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    pagespeed admin stuff is all logged in memory as far as I know so no files to check for but strange it's all blank.

    statistics page has nothing ?
     
  16. BamaStangGuy

    BamaStangGuy Premium Member Premium Member

    651
    189
    43
    May 25, 2014
    Ratings:
    +264
    Local Time:
    4:35 AM
    Nope. Nothing at all. This is the source of the page:

    Code:
    <!DOCTYPE html>
    <html><head><style>a {text-decoration:none; color:#15c; cursor:pointer;}a:visited {color: #61c;}a:hover {text-decoration:underline;}a:active {text-decoration:underline; color:#d14836;}</style><style>/* net/instaweb/rewriter/console.css */
    /*
    * Copyright 2012 Google Inc.
    *
    * Licensed under the Apache License, Version 2.0 (the "License");
    * you may not use this file except in compliance with the License.
    * You may obtain a copy of the License at
    *
    * http://www.apache.org/licenses/LICENSE-2.0
    *
    * Unless required by applicable law or agreed to in writing, software
    * distributed under the License is distributed on an "AS IS" BASIS,
    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    * See the License for the specific language governing permissions and
    * limitations under the License.
    */
    /**
    * @fileoverview Styles for the mod_pagespeed console.
    *
    * @author sarahdw@google.com (Sarah Dapul-Weberman)
    * @author bvb@google.com (Ben VanBerkum)
    * @author joseantonio@google.com (Jose Antonio Martinez)
    */
    @charset "UTF-8";
    /*------------------------------------------------------------------
    eric meyer's reset. Note, this originally had a few items that were
    eliminated because they affected the admin navigation bar
    (html,body,div) or were unused, based on a chrome dev tools audit
    (blockquote,ol,ul,table,caption,tb,td).
    ------------------------------------------------------------------*/
    span,applet,object,iframe,
    h1,h2,h3,h4,h5,h6,p,pre,
    a,abbr,acronym,address,big,cite,code,
    del,dfn,em,font,img,ins,kbd,q,s,samp,
    small,strike,strong,sub,sup,tt,var,
    dl,dt,dd,li,
    fieldset,form,label,legend,
    tbody,tfoot,thead,tr {
    margin: 0;
    padding: 0;
    border: 0;
    outline: 0;
    font-weight: inherit;
    font-style: inherit;
    font-size: 100%;
    font-family: inherit;
    vertical-align: baseline;
    }
    body {
    line-height: 1;
    color: black;
    background: white;
    }
    input::-moz-focus-inner {
    border: 0;
    }
    /*------------------------------------------------------------------
    @global Type
    ------------------------------------------------------------------*/
    body,body input,body button,body td {
    font-family: sans-serif;
    color: #222;
    font-size:13px;
    -webkit-tap-highlight-color: rgba(0,0,0,0);
    }
    strong, b {
    font-weight:bold;
    }
    /*------------------------------------------------------------------
    mod rules
    ------------------------------------------------------------------*/
    .pagespeed-widgets {
    background-color: #FFFFFF;
    border: 1px solid #CCCCCC;
    box-shadow: 0 15px 10px -10px rgba(0, 0, 0, 0.5), 0 1px 4px rgba(0, 0, 0, 0.3), 0 0 40px rgba(0, 0, 0, 0.1) inset;
    float: left;
    margin: 20px 0 0 20px;
    min-width: 500px;
    }
    .pagespeed-widgets-topbar {
    background-color: #F2F2F2;
    border-bottom:1px solid #E5E5E5;
    height: 35px;
    width: 100%;
    }
    .pagespeed-widgets-topbar .pagespeed-title {
    font-weight: bold;
    padding: 10px 0 4px 20px;
    width: 85%;
    float: left;
    }
    </style>
    </head><body><div style='font-size:16px;font-family:sans-serif;'>
    <b>Pagespeed Admin</b> &nbsp;&nbsp;
    <a href='[URL='https://www.aspiescentral.com/pagespeed_console?']?[/URL]'>Statistics</a> &nbsp;&nbsp; <a href='[URL='https://www.aspiescentral.com/pagespeed_console?config']?config[/URL]'>Configuration</a> <a href='[URL='https://www.aspiescentral.com/pagespeed_console?spdy_config']?spdy_config[/URL]'>(SPDY)</a> &nbsp;&nbsp; <a href='[URL='https://www.aspiescentral.com/pagespeed_console?histograms']?histograms[/URL]'>Histograms</a> &nbsp;&nbsp; <a href='[URL='https://www.aspiescentral.com/pagespeed_console?cache']?cache[/URL]'>Caches</a> &nbsp;&nbsp; </div><hr/>
    <div class='console_div' id='suggestions'>
    <div class='console_div' id='pagespeed-graphs-container'></div>
    </div>
    <script src='[URL]https://www.google.com/jsapi[/URL]'></script>
    <script>var pagespeedStatisticsUrl = '';</script>
    <script>(function(){var f=Object,g=document,k="appendChild",l="evaluate",m="createElement",n="setAttribute",q="propertyIsEnumerable",r="push",s="length",t="prototype",u="call",v=function(a){var b=typeof a;if("object"==b)if(a){if(a instanceof Array)return"array";if(a instanceof f)return b;var c=f[t].toString[u](a);if("[object Window]"==c)return"object";if("[object Array]"==c||"number"==typeof a[s]&&"undefined"!=typeof a.splice&&"undefined"!=typeof a[q]&&!a[q]("splice"))return"array";if("[object Function]"==c||"undefined"!=
    typeof a[u]&&"undefined"!=typeof a[q]&&!a[q]("call"))return"function"}else return"null";else if("function"==b&&"undefined"==typeof a[u])return"object";return b},w="closure_uid_"+(1E9*Math.random()>>>0),x=0;var y="StopIteration"in this?this.StopIteration:Error("StopIteration"),z=function(){};z[t].a=function(){throw y;};z[t].d=function(){return this};var A=function(a){var b=[],c=0,d;for(d in a)b[c++]=a[d];return b};var C=function(a,b){this.a={};this.b=[];this.f=this.e=0;var c=arguments[s];if(1<c){if(c%2)throw Error("Uneven number of arguments");for(var d=0;d<c;d+=2)this.set(arguments[d],arguments[d+1])}else if(a){if(a instanceof C)D(a),d=a.b.concat(),c=a.g();else{var c=[],e=0;for(d in a)c[e++]=d;d=c;c=A(a)}for(e=0;e<d[s];e++)this.set(d[e],c[e])}};C[t].g=function(){D(this);for(var a=[],b=0;b<this.b[s];b++)a[r](this.a[this.b[b]]);return a};
    var D=function(a){if(a.e!=a.b[s]){for(var b=0,c=0;b<a.b[s];){var d=a.b[b];f[t].hasOwnProperty[u](a.a,d)&&(a.b[c++]=d);b++}a.b.length=c}if(a.e!=a.b[s]){for(var e={},c=b=0;b<a.b[s];)d=a.b[b],f[t].hasOwnProperty[u](e,d)||(a.b[c++]=d,e[d]=1),b++;a.b.length=c}};C[t].set=function(a,b){f[t].hasOwnProperty[u](this.a,a)||(this.e++,this.b[r](a),this.f++);this.a[a]=b};
    C[t].d=function(a){D(this);var b=0,c=this.b,d=this.a,e=this.f,h=this,p=new z;p.a=function(){for(;;){if(e!=h.f)throw Error("The map has changed since the iterator was created");if(b>=c[s])throw y;var p=c[b++];return a?p:d[p]}};return p};var E=function(a){if("function"==typeof a.g)return a.g();if("string"==typeof a)return a.split("");var b=v(a);if("array"==b||"object"==b&&"number"==typeof a[s]){for(var b=[],c=a[s],d=0;d<c;d++)b[r](a[d]);return b}return A(a)};var G=function(a){this.a=new C;a&&F(this,a)},H=function(a){var b=typeof a;return"object"==b&&a||"function"==b?"o"+(a[w]||(a[w]=++x)):b.substr(0,1)+a},F=function(a,b){for(var c=E(b),d=c[s],e=0;e<d;e++){var h=c[e];a.a.set(H(h),h)}};G[t].g=function(){return this.a.g()};G[t].d=function(){return this.a.d(!1)};google.load("visualization","1.0",{packages:["corechart"]});
    var I=function(a){window.console&&console.error(a)},J=function(){this.a=[];this.f=new G;this.d=this.e=null;this.n={width:900,height:255,colors:["#4ECDC4","#556270","#C7F464"],legend:{position:"bottom"},hAxis:{format:"MMM d, y hh:mma",gridlines:{color:"#F2F2F2"},baselineColor:"#E5E5E5"},vAxis:{format:"#.###%",minValue:0,viewWindowMode:"explicit",viewWindow:{min:0},gridlines:{color:"#F2F2F2"},baselineColor:"#E5E5E5"},chartArea:{left:60,top:20,width:800},pointSize:2}},K=function(a){var b={};b.c=new G([a]);
    b.evaluate=function(b){return b(a)};return b},L=function(a){var b={};b.c=new G;for(var c=0;c<a[s];c++)F(b.c,a[c].c);b.evaluate=function(b){for(var c=0,h=0;h<a[s];h++)c+=a[h][l](b);return c};return b},M=function(a,b){var c={};c.c=new G;F(c.c,a.c);F(c.c,b.c);c.evaluate=function(c){var e=b[l](c);return 0==e?0:a[l](c)/e};return c},N=function(a,b){return M(a,L([a,b]))},O=function(a,b,c,d){var e={};e.title=b;e.l="https://developers.google.com/speed/pagespeed/module/console#"+c;e.value=d;e.m=a.a[s];e.h=
    null;e.i=null;e.j=null;e.k=null;a.a[r](e);F(a.f,d.c)},P=function(a,b,c){var d=pagespeedStatisticsUrl+"?json",d=d+("&start_time="+b.getTime()),d=d+("&end_time="+c.getTime()),d=d+"&granularity=60000&var_titles=";for(b=0;b<a[s];b++)d+=a[b]+",";return d},R=function(a,b,c){var d=new XMLHttpRequest;b=P(a.f.g(),b,c);d.onreadystatechange=function(){if(4==this.readyState)if(200!=this.status||1>this.responseText[s]||"{"!=this.responseText[0])I("XHR request failed.");else{var b=JSON.parse(this.responseText);
    Q(a,b)}};d.open("GET",b);d.send()},Q=function(a,b){a.e=b.variables;a.d=b.timestamps;S(a.d,a.e);for(var c=0;c<a.a[s];c++){for(var d=[],e=0;e<a.d[s];e++)d[r](a.a[c].value[l](function(a){return function(b){if(b in a)return a[b][e];I("JSON data missing required variable.")}}(a.e)));a.a[c].h=d[d[s]-1];a.a[c].i=a.a[c].h;a.a[c].j=T(a.a[c].title,a.d,d)}a.a.sort(function(a,b){return b.i-a.i});for(c=0;c<a.a[s];c++)U(a,a.a[c])},S=function(a,b){for(var c in b)a[s]!=b[c][s]&&I("JSON response is malformed. ("+
    a[s]+" != "+b[c][s]+")")},T=function(a,b,c){var d=new google.visualization.DataTable;d.addColumn("datetime","Time");d.addColumn("number",a);for(var e=0;e<b[s];e++)d.addRow([new Date(b[e]),c[e]]);0==d.getNumberOfRows()&&I("Data failed to load for graph "+a);return d},U=function(a,b){var c=google.visualization.LineChart,d=b.title,e=b.h,h=b.l,p=b.m,B=g[m]("div");B[n]("class","pagespeed-widgets");B[k](V(d,e,h,p));d=g[m]("div");d[n]("class","pagespeed-graph");B[k](d);g.getElementById("pagespeed-graphs-container")[k](B);
    b.k=new c(d);b.k.draw(b.j,a.n)},V=function(a,b,c,d){var e=g[m]("div");e[n]("class","pagespeed-widgets-topbar");var h=g[m]("span");h[n]("class","pagespeed-title");h[n]("id","pagespeed-title"+d);h[k](g.createTextNode(a+": "+(100*b).toFixed(2)+"% ("));a=g[m]("a");a[n]("href",c);a[k](g.createTextNode("doc"));h[k](a);h[k](g.createTextNode(")"));e[k](h);return e};google.setOnLoadCallback(function(){var a=new J;O(a,"Resources not loaded because of fetch failures","fetch-failure",M(K("serf_fetch_failure_count"),K("serf_fetch_request_count")));O(a,"Resources not rewritten because domain wasn't authorized","not-authorized",N(K("resource_url_domain_rejections"),K("resource_url_domain_acceptances")));O(a,"Resources not rewritten because of restrictive Cache-Control headers","cache-control",N(K("num_cache_control_not_rewritable_resources"),K("num_cache_control_rewritable_resources")));
    var b=L([K("cache_backend_misses"),K("cache_backend_hits")]);O(a,"Cache misses","cache-miss",M(K("cache_backend_misses"),b));O(a,"Cache lookups that were expired","cache-expired",M(K("cache_expirations"),b));O(a,"CSS files not rewritten because of parse errors","css-error",N(K("css_filter_parse_failures"),K("css_filter_blocks_rewritten")));O(a,"JavaScript minification failures","js-error",N(K("javascript_minification_failures"),K("javascript_blocks_minified")));var b=L([K("image_rewrites"),K("image_rewrites_dropped_nosaving_resize"),
    K("image_rewrites_dropped_nosaving_noresize")]),c=L([K("image_norewrites_high_resolution"),K("image_rewrites_dropped_decode_failure"),K("image_rewrites_dropped_due_to_load"),K("image_rewrites_dropped_mime_type_unknown"),K("image_rewrites_dropped_server_write_fail")]);O(a,"Image rewrite failures","image-error",N(c,b));b=new Date;R(a,new Date(b-864E5),b);return a});})();
    </script>
    </body></html>
    
     
  17. eva2000

    eva2000 Administrator Staff Member

    45,703
    10,377
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +16,103
    Local Time:
    8:35 PM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    try going to your main server's hostname.com/pagespeed_global_admin
     
  18. BamaStangGuy

    BamaStangGuy Premium Member Premium Member

    651
    189
    43
    May 25, 2014
    Ratings:
    +264
    Local Time:
    4:35 AM
    Same deal with hostname and just the ip address

    Screen Shot 2014-05-29 at 4.46.42 AM.png
     
  19. eva2000

    eva2000 Administrator Staff Member

    45,703
    10,377
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +16,103
    Local Time:
    8:35 PM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    weird never seen that before - you do have pagespeedadmin.conf in nginx.conf uncommented/enabled right ?
     
  20. BamaStangGuy

    BamaStangGuy Premium Member Premium Member

    651
    189
    43
    May 25, 2014
    Ratings:
    +264
    Local Time:
    4:35 AM
    Yep.

    Screen Shot 2014-05-29 at 4.52.48 AM.png

    Want me to shoot you the credentials so you can look around when you get a chance?