Get the most out of your Centmin Mod LEMP stack
Become a Member

PageSpeed Console Logs not working properly

Discussion in 'Nginx, PHP-FPM & MariaDB MySQL' started by RB1, Jan 28, 2017.

  1. RB1

    RB1 Active Member

    292
    75
    28
    Nov 11, 2016
    California
    Ratings:
    +122
    Local Time:
    9:02 PM
    Nginx 1.21.x
    MariaDB 10.1.x
    • CentOS Version: CentOS 7 64bit ?
    • Centmin Mod Version Installed: 123.09beta01
    • Nginx Version Installed: i.e. 1.11.9
    • When was last time updated Centmin Mod code base ? : today
    Quick question here. In http://domain.com/pagespeed_admin/console I have the error:
    pagespeedstatslog.conf contains:
    Code (Text):
    pagespeed Statistics on;
    pagespeed StatisticsLogging on;
    pagespeed LogDir /var/log/pagespeed;

    pagespeedadmin.conf contains:
    Code (Text):
    pagespeed MessageBufferSize 100000

    When I visit http://domain.com/pagespeed_admin/console I'm getting the error. The rest of /pagespeed_admin/ is working properly.

     
  2. eva2000

    eva2000 Administrator Staff Member

    54,934
    12,240
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,812
    Local Time:
    2:02 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    The url is actually either /pagespeed_global_admin/ and /pagespeed_console the former has the full stats now

    Also did you whitelist your ip

    from https://community.centminmod.com/th...e-revamp-in-ngx_pagespeed-1-9-32-1-beta.1669/ and Nginx PageSpeed - CentminMod.com LEMP Nginx web stack for CentOS

     
  3. RB1

    RB1 Active Member

    292
    75
    28
    Nov 11, 2016
    California
    Ratings:
    +122
    Local Time:
    9:02 PM
    Nginx 1.21.x
    MariaDB 10.1.x
    Yes I followed all the steps as well as whitelisted my IP.
    I used the same IP that my server tells me I last logged in from (IPv4).
    Should I configure pagespeedhandler with IPv6 address?
     
  4. eva2000

    eva2000 Administrator Staff Member

    54,934
    12,240
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,812
    Local Time:
    2:02 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
  5. RB1

    RB1 Active Member

    292
    75
    28
    Nov 11, 2016
    California
    Ratings:
    +122
    Local Time:
    9:02 PM
    Nginx 1.21.x
    MariaDB 10.1.x
    The IP there is an IPv6 address
    But when I login to my server it shows last login IP as IPv4

    Should I just add the IPv6 in brackets to my pagespeedhander config?
    It's weird that everything in pagespeed_admin works except for the console
     
  6. eva2000

    eva2000 Administrator Staff Member

    54,934
    12,240
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,812
    Local Time:
    2:02 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    so your ISP has ipv6 support ? yes try adding IPv6 in allow whitelisted ips
     
  7. RB1

    RB1 Active Member

    292
    75
    28
    Nov 11, 2016
    California
    Ratings:
    +122
    Local Time:
    9:02 PM
    Nginx 1.21.x
    MariaDB 10.1.x
    No, still same error:
     
  8. eva2000

    eva2000 Administrator Staff Member

    54,934
    12,240
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,812
    Local Time:
    2:02 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    what does the contents of your /usr/local/nginx/conf/pagespeedhandler.conf look like ?

    i.e.
    Code (Text):
    #  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 ~ "^/pagespeed_static/" { }
    location ~ "^/ngx_pagespeed_beacon$" { }
    location /ngx_pagespeed_statistics { allow 127.0.0.1; deny all; }
    location /ngx_pagespeed_global_statistics { allow 127.0.0.1; deny all; }
    location /ngx_pagespeed_message { allow 127.0.0.1; 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; }
     
  9. RB1

    RB1 Active Member

    292
    75
    28
    Nov 11, 2016
    California
    Ratings:
    +122
    Local Time:
    9:02 PM
    Nginx 1.21.x
    MariaDB 10.1.x
    Now it looks like this after adding IPv6:
    Code (Text):
    #  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 ~ "^/pagespeed_static/" { }
    location ~ "^/ngx_pagespeed_beacon$" { }
    location /ngx_pagespeed_statistics { allow 127.0.0.1; allow 26.5.189.203; allow [2601:290:8200:c4:ef75:58b4:49ac:c89e]; deny all; }
    location /ngx_pagespeed_global_statistics { allow 127.0.0.1; allow 26.5.189.203; allow [2601:290:8200:c4:ef75:58b4:49ac:c89e]; deny all; }
    location /ngx_pagespeed_message { allow 127.0.0.1; allow 26.5.189.203; allow [2601:290:8200:c4:ef75:58b4:49ac:c89e]; deny all; }
    location /pagespeed_console { allow 127.0.0.1; allow 26.5.189.203; allow [2601:290:8200:c4:ef75:58b4:49ac:c89e]; deny all; }
    location ~ ^/pagespeed_admin { allow 127.0.0.1; allow 26.5.189.203; allow [2601:290:8200:c4:ef75:58b4:49ac:c89e]; deny all; }
    location ~ ^/pagespeed_global_admin { allow 127.0.0.1; allow 26.5.189.203; allow [2601:290:8200:c4:ef75:58b4:49ac:c89e]; deny all; }
     
  10. eva2000

    eva2000 Administrator Staff Member

    54,934
    12,240
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,812
    Local Time:
    2:02 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    IPv6 ips don't have square brackets that is only for nginx syntax so remove the [] enclosing the IPv6 ip :)
     
  11. RB1

    RB1 Active Member

    292
    75
    28
    Nov 11, 2016
    California
    Ratings:
    +122
    Local Time:
    9:02 PM
    Nginx 1.21.x
    MariaDB 10.1.x
    Oh I was not aware of that. I assumed it required brackets because of nginx config and also accessing via IPv6 in browser http://[::]

    Still same error after restart :(
     
  12. eva2000

    eva2000 Administrator Staff Member

    54,934
    12,240
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,812
    Local Time:
    2:02 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    did you restart nginx after making changes ?
     
  13. RB1

    RB1 Active Member

    292
    75
    28
    Nov 11, 2016
    California
    Ratings:
    +122
    Local Time:
    9:02 PM
    Nginx 1.21.x
    MariaDB 10.1.x
    Yes I did
     
  14. eva2000

    eva2000 Administrator Staff Member

    54,934
    12,240
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,812
    Local Time:
    2:02 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    strange so both urls don't work /pagespeed_global_admin/ and /pagespeed_console ?
     
  15. RB1

    RB1 Active Member

    292
    75
    28
    Nov 11, 2016
    California
    Ratings:
    +122
    Local Time:
    9:02 PM
    Nginx 1.21.x
    MariaDB 10.1.x
    Yes, same error on both URLs :unsure:
    The only 2 error messages are related to StatisticsLogging and LogDir and they are both set in pagespeedstatslog.conf unless it's just a generic error message
     
  16. RB1

    RB1 Active Member

    292
    75
    28
    Nov 11, 2016
    California
    Ratings:
    +122
    Local Time:
    9:02 PM
    Nginx 1.21.x
    MariaDB 10.1.x
    I'll see if anyone over at the ngx_pagespeed Git knows what's going on
     
  17. RB1

    RB1 Active Member

    292
    75
    28
    Nov 11, 2016
    California
    Ratings:
    +122
    Local Time:
    9:02 PM
    Nginx 1.21.x
    MariaDB 10.1.x
    So...I guess I found the problem :)
    Inside domain.com.conf:
    Uncommenting the third line fixed the console. Should I uncomment all three lines?

    Also...what is virtual.com compared to each separate domain.com.conf?
     
  18. eva2000

    eva2000 Administrator Staff Member

    54,934
    12,240
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,812
    Local Time:
    2:02 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    yes part of enabling ngx_pagespeed instructions at Nginx PageSpeed - CentminMod.com LEMP Nginx web stack for CentOS ;)

    step 2.
     
  19. RB1

    RB1 Active Member

    292
    75
    28
    Nov 11, 2016
    California
    Ratings:
    +122
    Local Time:
    9:02 PM
    Nginx 1.21.x
    MariaDB 10.1.x
    Ahh...forgot about that on my newer server.
    Guess I didn't notice until the Console wasn't working because PageSpeed was working correctly on some of my domains even with the lines commented out.

    Now that this is solved, I need to figure out what it's not working with Cloudflare :p