Want more timely Centmin Mod News Updates?
Become a Member

Nginx Optimizing Your Website with the Google PageSpeed Dynamic Module for NGINX Plus

Discussion in 'Nginx and PHP-FPM news & discussions' started by eva2000, Mar 4, 2017.

  1. eva2000

    eva2000 Administrator Staff Member

    30,546
    6,849
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,262
    Local Time:
    3:14 AM
    Nginx 1.13.x
    MariaDB 5.5
    Nginx Inc now offers commercial Nginx Plus web server with Google PageSpeed Dynamic Module support. The ngx_pagespeed Nginx module is something that Centmin Mod already offers via free open source Nginx version already and can be enabled in latest Centmin Mod 123.09beta01 version as outlined at here :)

    For Nginx Plus commercial web server, Google PageSpeed Dynamic Module Google PageSpeed as a Dynamic Module for NGINX Plus
     
    Last edited: Mar 4, 2017
    • Like Like x 1
  2. eva2000

    eva2000 Administrator Staff Member

    30,546
    6,849
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,262
    Local Time:
    3:14 AM
    Nginx 1.13.x
    MariaDB 5.5
    Centmin Mod already offers via free open source Nginx version already and can be enabled in latest Centmin Mod 123.09beta01 version as outlined at here. Centmin Mod Nginx has supported ngx_pagspeed since June 2013 and supported Nginx PageSpeed module as a dynamic module since February 2016. The benefits that Nginx PageSpeed provide of improved page load speed are real https://community.centminmod.com/threads/benefits-of-ngx_pagespeed.1032/ :)

    Enabling Google PageSpeed Support In Centmin Mod Nginx



    To enable support for ngx_pagespeed on Centmin Mod 123.09beta01, set in persistent config file /etc/centminmod/custom_config.inc the following variables
    Code (Text):
    NGXDYNAMIC_NGXPAGESPEED='y'
    NGINX_PAGESPEED='y'
    

    Then recompile latest Nginx 1.11.10 via centmin.sh menu option 4. Result is
    Centmin Mod installs Nginx dynamic modules to /usr/local/nginx/modules. The .old ones are auto renamed from previous Nginx compiles by Nginx - sort of a backup.
    Code (Text):
    ls -lah /usr/local/nginx/modules
    total 34M
    drwxr-xr-x.  2 root root 4.0K Mar  1 09:06 .
    drwxr-xr-x. 11 root root 4.0K Feb 21 15:05 ..
    -rwxr-xr-x   1 root root 1.3M Mar  1 09:06 ngx_http_brotli_filter_module.so
    -rwxr-xr-x   1 root root 1.3M Feb 23 07:36 ngx_http_brotli_filter_module.so.old
    -rwxr-xr-x   1 root root  29K Mar  1 09:06 ngx_http_brotli_static_module.so
    -rwxr-xr-x   1 root root  36K Feb 23 07:36 ngx_http_brotli_static_module.so.old
    -rwxr-xr-x   1 root root  52K Mar  1 09:06 ngx_http_fancyindex_module.so
    -rwxr-xr-x   1 root root  59K Feb 23 07:36 ngx_http_fancyindex_module.so.old
    -rwxr-xr-x   1 root root  51K Mar  1 09:06 ngx_http_image_filter_module.so
    -rwxr-xr-x   1 root root  58K Feb 23 07:36 ngx_http_image_filter_module.so.old
    -rwxr-xr-x   1 root root  16M Mar  1 09:06 ngx_pagespeed.so
    -rwxr-xr-x   1 root root  16M Feb 23 07:36 ngx_pagespeed.so.old
    -rwxr-xr-x   1 root root 428K Mar  1 09:06 ngx_stream_module.so
    -rwxr-xr-x   1 root root 507K Feb 23 07:36 ngx_stream_module.so.old
    

    The Nginx dynamic modules are loaded via include file /usr/local/nginx/conf/dynamic-modules.conf in /usr/local/nginx/conf/nginx.conf

    In /usr/local/nginx/conf/nginx.conf
    Code (Text):
    include /usr/local/nginx/conf/dynamic-modules.conf;
    

    contents of /usr/local/nginx/conf/dynamic-modules.conf
    Code (Text):
    load_module "modules/ngx_http_image_filter_module.so";
    load_module "modules/ngx_http_fancyindex_module.so";
    load_module "modules/ngx_pagespeed.so";
    load_module "modules/ngx_http_brotli_filter_module.so";
    load_module "modules/ngx_http_brotli_static_module.so";
    load_module "modules/ngx_stream_module.so";
    

    The image filter, fancyindex and stream modules are default enabled Nginx dynamic modules. Nginx pagespeed and Brotli ones are optionally enabled by me via persistent config file set variables prior to centmin.sh menu option 4 recompile of Nginx.
    Code (Text):
    NGXDYNAMIC_NGXPAGESPEED='y'
    NGINX_PAGESPEED='y'
    NGXDYNAMIC_BROTLI=y
    NGINX_LIBBROTLI=y
    


    Nginx PageSpeed Configuration



    Once ngx_pagespeed is compiled and installed into Nginx, you need to configure the pagespeed.conf and nginx pagespeed filters as outlined here and below links. Specifically for your web site and web site's theme and page elements. No one web site will have exact same pagespeed.conf settings and pagespeed filter combinations.

    Nginx PageSpeed Troubleshooting



    You'd have to troubleshoot and tweak it yourself following these guides and info outlined below

    Other Nginx PageSpeed Links & Info


    Official Nginx PageSpeed Documentation


    • Official Nginx PageSpeed documentation is hosted on mod_pagespeed site at https://modpagespeed.com/doc/. Mod_pagespeed is the Apache version of Google PageSpeed. So docs outline both mod_pagespeed for Apache and ngx_pagespeed for Nginx in the same manual :)
     
    Last edited: Mar 4, 2017
    • Like Like x 1
    • Informative Informative x 1