Want to subscribe to topics you're interested in?
Become a Member

Nginx PageSpeed PageSpeed isn't compressing images even with tweaked conf.

Discussion in 'Nginx, PHP-FPM & MariaDB MySQL' started by cr0, Sep 10, 2017.

  1. cr0

    cr0 Member

    38
    4
    8
    Aug 21, 2017
    Ratings:
    +4
    Local Time:
    5:22 AM
    Yep! Just thought about it, and added

    Code:
    { allow 127.0.0.1; allow mypublicip; deny all; }
    But I'm still receiving the 403 forbidden error.
     
  2. eva2000

    eva2000 Administrator Staff Member

    45,432
    10,308
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,987
    Local Time:
    1:22 PM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    after editing nginx files, did you restart nginx ?

    for admin console need to add server ip to allow list there too
     
  3. cr0

    cr0 Member

    38
    4
    8
    Aug 21, 2017
    Ratings:
    +4
    Local Time:
    5:22 AM
    Yes!

    You mean in vhost conf's?

    After doing so I'm receiving this error:

    PHP:
    nginx: [emergduplicate location "/ngx_pagespeed_global_statistics" in /usr/local/nginx/conf/pagespeedhandler.conf:7
    nginx
    configuration file /usr/local/nginx/conf/nginx.conf test failed
     
  4. eva2000

    eva2000 Administrator Staff Member

    45,432
    10,308
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,987
    Local Time:
    1:22 PM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    check where all instances of ngx_pagespeed_global_statistics are using recursive grep command

    what's output for
    Code (Text):
    grep -rn ngx_pagespeed_global_statistics /usr/local/nginx/conf
    
     
  5. cr0

    cr0 Member

    38
    4
    8
    Aug 21, 2017
    Ratings:
    +4
    Local Time:
    5:22 AM
    Hello. Here's the output:
    PHP:
    /usr/local/nginx/conf/pagespeedadmin.conf:19:pagespeed GlobalStatisticsPath /ngx_pagespeed_global_statistics;
    /
    usr/local/nginx/conf/pagespeedhandler.conf:7:location /ngx_pagespeed_global_statistics allow 127.0.0.1allow mypublicipdeny all; }
    ADD:
    When using nginx -t this time, a warning appeared:
    Code:
    nginx: [warn] conflicting server name "mydomain.com" on 0.0.0.0:80, ignored
    
    ----

    Browser caching expiration still isn't working!

    [​IMG]
     
    Last edited: Sep 11, 2017
  6. cr0

    cr0 Member

    38
    4
    8
    Aug 21, 2017
    Ratings:
    +4
    Local Time:
    5:22 AM
    More:

    After tweaking pagespeed (I still can't access the admin page, 403 forbidden error), I got the files minify right and images seem to start working (but can't check it though without the console).

    The issue is that pagespeed doesn't combine JS and CSS. I think it's all good in pagespeed conf, after reading the doc's:

    PHP:
    pagespeed on;

    pagespeed MapOriginDomain "http://localhost" "https://MYDOMAIN.com";
    pagespeed LoadFromFile "https://MYDOMAIN.com" "/home/nginx/domains/MYDOMAIN.com/public";

    pagespeed SslCertDirectory /usr/local/nginx/conf/ssl/MYDOMAIN.com;
    pagespeed SslCertFile /usr/local/nginx/conf/ssl/MYDOMAIN.com/public.pem;

    pagespeed Domain http://MYDOMAIN.com;
    pagespeed Domain https://MYDOMAIN.com;
    pagespeed Domain *.MYDOMAIN.com;

    pagespeed MaxSegmentLength 3500;
    pagespeed MaxSegmentLength 3500;

    pagespeed UseExperimentalJsMinifier on;

    pagespeed EnableFilters fallback_rewrite_css_urls;

    #######################################################
    # Purge nginx pagespeed cache
    # https://developers.google.com/speed/pagespeed/module/system#flush_cache
    #######################################################
    pagespeed EnableCachePurge on;
    pagespeed PurgeMethod PURGE;

    #######################################################
    # File cache settings
    ######################################
    # needs to exist and be writable by nginx

    # pagespeed FileCacheSizeKb          102400;
    # pagespeed FileCacheCleanIntervalMs 3600000;
    # pagespeed FileCacheInodeLimit      500000;

    #######################################################
    # By default, ngx_pagespeed adds an X-PageSpeed header with a value of the version of
    # ngx_pagespeed being used. This directive lets you specify the value to use instead:
    # pagespeed XHeaderValue "ngx_pagespeed";

    #######################################################
    # let's speed up PageSpeed by storing it in the super duper fast memcached
    # Ensure Memcached server installed http://centminmod.com/memcached.html
    # default install for centmin mod is on port 11211, so localhost:11211 is correct
    # uncomment - remove hash # in front of below 2 lines to enable
    # timeout set at 100 milliseconds
    pagespeed MemcachedThreads 1;
    pagespeed MemcachedServers "localhost:11211";
    pagespeed MemcachedTimeoutUs 100000;

    #######################################################
    ## 1.11.33.0 beta save-data
    ######################################
    # https://developers.google.com/speed/pagespeed/module/filter-image-optimize#image-quality

    # https://developers.google.com/speed/pagespeed/module/reference-image-optimize#JpegQualityForSaveData
    pagespeed JpegQualityForSaveData 50;

    # https://developers.google.com/speed/pagespeed/module/reference-image-optimize#WebpQualityForSaveData
    pagespeed WebpQualityForSaveData 50;

    #######################################################
    ## 1.7.30.1 beta defaults
    ######################################
    pagespeed PreserveUrlRelativity on;
    pagespeed MaxCombinedCssBytes -1;
    pagespeed ImageResolutionLimitBytes 16777216;
    # pagespeed EnableFilters inline_google_font_css;

    #######################################################
    ## 1.6.29.3 beta defaults
    ######################################
    pagespeed AvoidRenamingIntrospectiveJavascript on;
    pagespeed ImageInlineMaxBytes 3072;
    pagespeed CssImageInlineMaxBytes 0;
    pagespeed MaxInlinedPreviewImagesIndex -1;
    pagespeed MinImageSizeLowResolutionBytes 3072;

    #######################################################
    ## ngx_pagespeed filters settings below ##
    ######################################

      # show half the users an optimized site, half the regular site
      # change UA-XXXXXXXXXX-1 to your GA unique id
      # uncomment - remove hash # in front of below 5 lines to enable
    #  pagespeed RunExperiment on;
    #  pagespeed AnalyticsID UA-XXXXXXXXXX-1;
    #  pagespeed ExperimentVariable 1;
    #  pagespeed ExperimentSpec "id=1;percent=50;level=CoreFilters;enabled=collapse_whitespace,remove_comments;";
    #  pagespeed ExperimentSpec "id=2;percent=50";
     
      # Filter settings
      # filters outlined at http://ngxpagespeed.com/ngx_pagespeed_example/
      
    pagespeed RewriteLevel CoreFilters;
      
    pagespeed EnableFilters collapse_whitespace,remove_comments;

      
    # make_google_analytics_async
      # https://developers.google.com/speed/docs/mod_pagespeed/filter-make-google-analytics-async
    #  pagespeed EnableFilters make_google_analytics_async;

      # make_show_ads_async
      # https://developers.google.com/speed/pagespeed/module/filter-make-show-ads-async
    #  pagespeed EnableFilters make_show_ads_async;

      # responsive_images, responsive_images_zoom
      # https://developers.google.com/speed/pagespeed/module/filter-image-responsive
    #  pagespeed EnableFilters responsive_images;
    #  pagespeed EnableFilters responsive_images_zoom;

      # convert_to_webp_animated
      # https://developers.google.com/speed/pagespeed/module/filter-image-optimize#convert_to_webp_animated
      
    pagespeed EnableFilters convert_to_webp_animated;

      
    # inline_google_font_css
      # https://developers.google.com/speed/pagespeed/module/filter-css-inline-google-fonts
      
    pagespeed EnableFilters inline_google_font_css;
      
    # require FetchHttps if using https site
       
    pagespeed FetchHttps disable;

      
    # inline_css
      # https://developers.google.com/speed/pagespeed/module/filter-css-inline
    pagespeed EnableFilters inline_css;
     
    pagespeed CssInlineMaxBytes 5048;

      
    # prioritize_critical_css
      # https://developers.google.com/speed/docs/mod_pagespeed/filter-prioritize-critical-css
    #   pagespeed EnableFilters prioritize_critical_css;

      # move_css_to_head
      # https://developers.google.com/speed/docs/mod_pagespeed/filter-css-to-head
      
    pagespeed EnableFilters move_css_to_head;

      
    # move_css_above_scripts
      # https://developers.google.com/speed/docs/mod_pagespeed/filter-css-above-scripts
    #  pagespeed EnableFilters move_css_above_scripts;

      # combine_css
      # https://developers.google.com/speed/docs/mod_pagespeed/filter-css-combine
    pagespeed EnableFilters combine_css;

       
    # Uncomment this if you want to prevent mod_pagespeed from combining files
       # (e.g. CSS files) across paths
       #
    #  pagespeed CombineAcrossPaths off;

      # combine_javascript
      # https://developers.google.com/speed/docs/mod_pagespeed/filter-js-combine
      
    pagespeed EnableFilters combine_javascript;
      
    pagespeed MaxCombinedJsBytes 150000;

      
    # extend_cache
      # https://developers.google.com/speed/docs/mod_pagespeed/filter-cache-extend
    pagespeed EnableFilters extend_cache;

      
    # rewrite_css
      # https://developers.google.com/speed/docs/mod_pagespeed/filter-css-rewrite
     
    pagespeed EnableFilters rewrite_css;

      
    # rewrite_javascript
      # https://developers.google.com/speed/docs/mod_pagespeed/filter-js-minify
    pagespeed EnableFilters rewrite_javascript;

      
    # inline_preview_images
      # https://developers.google.com/speed/pagespeed/module/filter-inline-preview-images
      
    pagespeed EnableFilters inline_preview_images;

      
    # lazyload_images
      # https://developers.google.com/speed/docs/mod_pagespeed/filter-lazyload-images
    #  pagespeed EnableFilters lazyload_images;

      # rewrite_images
      # https://developers.google.com/speed/docs/mod_pagespeed/filter-image-optimize
      
    pagespeed EnableFilters rewrite_images;
       
    pagespeed EnableFilters recompress_images;
       
    pagespeed DisableFilters convert_png_to_jpeg;
       
    pagespeed DisableFilters extend_cache_images;
    #  pagespeed EnableFilters convert_png_to_jpeg;
      
    pagespeed EnableFilters convert_jpeg_to_webp;
      
    pagespeed EnableFilters convert_to_webp_lossless;

      
    # sprite_images
      # https://developers.google.com/speed/docs/mod_pagespeed/filter-image-sprite
    # pagespeed EnableFilters rewrite_css,sprite_images;

      # insert_dns_prefetch
      # https://developers.google.com/speed/docs/mod_pagespeed/filter-insert-dns-prefetch
    #  pagespeed EnableFilters insert_dns_prefetch;

      # InPlaceResourceOptimization
      # https://developers.google.com/speed/pagespeed/module/system#ipro
      # Enabled by default as of 1.9.32.1
      
    pagespeed InPlaceResourceOptimization off;

    #######################################################
    See:

    [​IMG]
     
  7. eva2000

    eva2000 Administrator Staff Member

    45,432
    10,308
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,987
    Local Time:
    1:22 PM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    what output to you get for
    Code (Text):
    grep -rn -w 'server_name' /usr/local/nginx/conf | egrep -v '\$|localhost|demodomain|backup'
    

    and output for
    Code (Text):
    cat /usr/local/nginx/conf/pagespeedhandler.conf
    
     
  8. eva2000

    eva2000 Administrator Staff Member

    45,432
    10,308
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,987
    Local Time:
    1:22 PM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    output for
    Code (Text):
    grep -rn -w 'staticfiles.conf' /usr/local/nginx/conf | egrep -v 'demodomain|backup' 
    

    you're /usr/local/nginx/conf/staticfiles.conf file looks intact for include file in vhosts Nginx PageSpeed - PageSpeed isn't compressing images even with tweaked conf. so should show up unless cloudflare isn't caching them so test with cloudflare disabled to confirm
     
  9. cr0

    cr0 Member

    38
    4
    8
    Aug 21, 2017
    Ratings:
    +4
    Local Time:
    5:22 AM
    grep -rn -w 'server_name' /usr/local/nginx/conf | egrep -v '\$|localhost|demodomain|backup'
    PHP:
    /usr/local/nginx/conf/autoprotect/MYDOMAIN.com/autoprotect-MYDOMAIN.com.conf:1:# /home/nginx/domains/MYDOMAIN.com/public/wp-content/plugins/akismet
    /usr/local/nginx/conf/autoprotect/MYDOMAIN.com/autoprotect-MYDOMAIN.com.conf:13:# /home/nginx/domains/MYDOMAIN.com/public/wp-content/uploads/wc-logs
    /usr/local/nginx/conf/autoprotect/MYDOMAIN.com/autoprotect-MYDOMAIN.com.conf:15:# /home/nginx/domains/MYDOMAIN.com/public/wp-content/uploads/sucuri
    /usr/local/nginx/conf/autoprotect/MYDOMAIN.com/autoprotect-MYDOMAIN.com.conf:17:# /home/nginx/domains/MYDOMAIN.com/public/wp-content/uploads/woocommerce_uploads
    /usr/local/nginx/conf/conf.d/MYDOMAIN.com.conf:9:#            server_name MYDOMAIN.com;
    /usr/local/nginx/conf/conf.d/MYDOMAIN.com.conf:15:  server_name MYDOMAIN.com www.MYDOMAIN.com;
    /
    usr/local/nginx/conf/conf.d/MYDOMAIN.com.conf:29:  access_log /home/nginx/domains/MYDOMAIN.com/log/access.log combined buffer=256k flush=5m;
    /
    usr/local/nginx/conf/conf.d/MYDOMAIN.com.conf:30:  error_log /home/nginx/domains/MYDOMAIN.com/log/error.log;
    /
    usr/local/nginx/conf/conf.d/MYDOMAIN.com.conf:32:  include /usr/local/nginx/conf/autoprotect/MYDOMAIN.com/autoprotect-MYDOMAIN.com.conf;
    /
    usr/local/nginx/conf/conf.d/MYDOMAIN.com.conf:33:  root /home/nginx/domains/MYDOMAIN.com/public;
    /
    usr/local/nginx/conf/conf.d/MYDOMAIN.com.conf:39:  include /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpcacheenabler_MYDOMAIN.com.conf;
    /
    usr/local/nginx/conf/conf.d/MYDOMAIN.com.conf:40:  #include /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsupercache_MYDOMAIN.com.conf;
    /usr/local/nginx/conf/conf.d/MYDOMAIN.com.conf:42:  #include /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/rediscache_MYDOMAIN.com.conf;
    /usr/local/nginx/conf/conf.d/MYDOMAIN.com.conf:81:    auth_basic_user_file /home/nginx/domains/MYDOMAIN.com/htpasswd_wplogin;
    /
    usr/local/nginx/conf/conf.d/MYDOMAIN.com.conf:95:  include /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf;
    /
    usr/local/nginx/conf/conf.d/MYDOMAIN.com.conf:100:  include /usr/local/nginx/conf/pre-staticfiles-local-MYDOMAIN.com.conf;
    /
    usr/local/nginx/conf/conf.d/MYDOMAIN.com.ssl.conf:10:#   server_name MYDOMAIN.com www.MYDOMAIN.com;
    /usr/local/nginx/conf/conf.d/MYDOMAIN.com.ssl.conf:16:  server_name MYDOMAIN.com www.MYDOMAIN.com;
    /
    usr/local/nginx/conf/conf.d/MYDOMAIN.com.ssl.conf:18:  ssl_dhparam /usr/local/nginx/conf/ssl/MYDOMAIN.com/dhparam.pem;
    /
    usr/local/nginx/conf/conf.d/MYDOMAIN.com.ssl.conf:19:  ssl_certificate      /usr/local/nginx/conf/ssl/MYDOMAIN.com/public.pem;
    /
    usr/local/nginx/conf/conf.d/MYDOMAIN.com.ssl.conf:20:  ssl_certificate_key  /usr/local/nginx/conf/ssl/MYDOMAIN.com/private.key;
    /
    usr/local/nginx/conf/conf.d/MYDOMAIN.com.ssl.conf:43:  #ssl_trusted_certificate /usr/local/nginx/conf/ssl/MYDOMAIN.com/MYDOMAIN.com-trusted.crt;
    /usr/local/nginx/conf/conf.d/MYDOMAIN.com.ssl.conf:57:  access_log /home/nginx/domains/MYDOMAIN.com/log/access.log combined buffer=256k flush=5m;
    /
    usr/local/nginx/conf/conf.d/MYDOMAIN.com.ssl.conf:58:  error_log /home/nginx/domains/MYDOMAIN.com/log/error.log;
    /
    usr/local/nginx/conf/conf.d/MYDOMAIN.com.ssl.conf:60:  include /usr/local/nginx/conf/autoprotect/MYDOMAIN.com/autoprotect-MYDOMAIN.com.conf;
    /
    usr/local/nginx/conf/conf.d/MYDOMAIN.com.ssl.conf:61:  root /home/nginx/domains/MYDOMAIN.com/public;
    /
    usr/local/nginx/conf/conf.d/MYDOMAIN.com.ssl.conf:67:  include /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpcacheenabler_MYDOMAIN.com.conf;
    /
    usr/local/nginx/conf/conf.d/MYDOMAIN.com.ssl.conf:68:  #include /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsupercache_MYDOMAIN.com.conf;
    /usr/local/nginx/conf/conf.d/MYDOMAIN.com.ssl.conf:70:  #include /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/rediscache_MYDOMAIN.com.conf;
    /usr/local/nginx/conf/conf.d/MYDOMAIN.com.ssl.conf:98:    auth_basic_user_file /home/nginx/domains/MYDOMAIN.com/htpasswd_wplogin;
    /
    usr/local/nginx/conf/conf.d/MYDOMAIN.com.ssl.conf:118:  include /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf;
    /
    usr/local/nginx/conf/conf.d/MYDOMAIN.com.ssl.conf:123:  include /usr/local/nginx/conf/pre-staticfiles-local-MYDOMAIN.com.conf;
    /
    usr/local/nginx/conf/pagespeed.conf:4:pagespeed LoadFromFile "https://MYDOMAIN.com" "/home/nginx/domains/MYDOMAIN.com/public";
    /
    usr/local/nginx/conf/pagespeed.conf:5:pagespeed LoadFromFile "http://MYDOMAIN.com" "/home/nginx/domains/MYDOMAIN.com/public";
    /
    usr/local/nginx/conf/pagespeed.conf:7:pagespeed SslCertDirectory /usr/local/nginx/conf/ssl/MYDOMAIN.com;
    /
    usr/local/nginx/conf/pagespeed.conf:8:pagespeed SslCertFile /usr/local/nginx/conf/ssl/MYDOMAIN.com/public.pem;
    /
    usr/local/nginx/conf/pagespeed.conf:17:pagespeed Domain http://MYDOMAIN.com;
    /usr/local/nginx/conf/pagespeed.conf:18:pagespeed Domain https://MYDOMAIN.com;
    /usr/local/nginx/conf/pagespeed.conf:19:pagespeed Domain *.MYDOMAIN.com;
    /
    usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf:32:  # whitelist php processing access at /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf
    /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf:33:  #include /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpwhitelist_common.conf;
    /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf:46:  # whitelist php processing access at /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf
    /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf:47:  #include /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpwhitelist_common.conf;
    /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf:56:  # whitelist php processing access at /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf
    /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf:57:  #include /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpwhitelist_common.conf;
    /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf:66:  # whitelist php processing access at /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf
    /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf:67:  #include /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpwhitelist_common.conf;
    /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf:76:  # whitelist php processing access at /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf
    /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf:77:  #include /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpwhitelist_common.conf;
    /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf:86:  # whitelist php processing access at /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf
    /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf:87:  #include /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpwhitelist_common.conf;
    /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf:96:  # whitelist php processing access at /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf
    /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf:97:  #include /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpwhitelist_common.conf;
    /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf:106:  # whitelist php processing access at /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf
    /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf:107:  #include /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpwhitelist_common.conf;
    /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf:116:  # whitelist php processing access at /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf
    /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf:117:  #include /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpwhitelist_common.conf;
    /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf:126:  # whitelist php processing access at /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf
    /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf:127:  #include /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpwhitelist_common.conf;
    /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf:136:  # whitelist php processing access at /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf
    /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf:137:  #include /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpwhitelist_common.conf;
    /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf:146:  # whitelist php processing access at /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf
    /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf:147:  #include /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpwhitelist_common.conf;
    /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf:156:  # whitelist php processing access at /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf
    /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf:157:  #include /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpwhitelist_common.conf;
    /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf:166:  # whitelist php processing access at /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf
    /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf:167:  #include /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpwhitelist_common.conf;
    /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf:176:  # whitelist php processing access at /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf
    /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf:177:  #include /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpwhitelist_common.conf;
    /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf:186:  # whitelist php processing access at /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf
    /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf:187:  #include /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpwhitelist_common.conf;
    /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf:196:  # whitelist php processing access at /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf
    /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf:197:  #include /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpwhitelist_common.conf;
    /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf:206:  # whitelist php processing access at /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf
    /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf:207:  #include /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpwhitelist_common.conf;
    /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf:216:  # whitelist php processing access at /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf
    /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf:217:  #include /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpwhitelist_common.conf;
    /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf:226:  # whitelist php processing access at /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf
    /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf:227:  #include /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpwhitelist_common.conf;
    /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf:236:  # whitelist php processing access at /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf
    /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf:237:  #include /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpwhitelist_common.conf;
    /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf:246:  # whitelist php processing access at /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf
    /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf:247:  #include /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpwhitelist_common.conf;
    /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf:256:  # whitelist php processing access at /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf
    /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf:257:  #include /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpwhitelist_common.conf;
    /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf:266:  # whitelist php processing access at /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf
    /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf:267:  #include /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpwhitelist_common.conf;
    /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf:276:  # whitelist php processing access at /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf
    /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf:277:  #include /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpwhitelist_common.conf;
    /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf:286:  # whitelist php processing access at /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf
    /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf:287:  #include /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpwhitelist_common.conf;
    /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf:299:    # whitelist php processing access at /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf
    /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf:300:    #include /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpwhitelist_common.conf;
    /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf:312:  # whitelist php processing access at /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf
    /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf:313:  #include /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpwhitelist_common.conf;
    /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf:322:  # whitelist php processing access at /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf
    /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf:323:  #include /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpwhitelist_common.conf;
    /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf:332:  # whitelist php processing access at /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf
    /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf:333:  #include /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpwhitelist_common.conf;
    /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf:342:  # whitelist php processing access at /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf
    /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf:343:  #include /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpwhitelist_common.conf;
    /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf:352:  # whitelist php processing access at /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf
    /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf:353:  #include /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpwhitelist_common.conf;
    /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf:362:  # whitelist php processing access at /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf
    /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf:363:  #include /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpwhitelist_common.conf;
    /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf:372:  # whitelist php processing access at /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf
    /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf:373:  #include /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpwhitelist_common.conf;
    /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf:382:  # whitelist php processing access at /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf
    /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf:383:  #include /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpwhitelist_common.conf;
    /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf:392:  # whitelist php processing access at /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf
    /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf:393:  #include /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpwhitelist_common.conf;
    /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf:402:  # whitelist php processing access at /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf
    /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf:403:  #include /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpwhitelist_common.conf;
    /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf:412:  # whitelist php processing access at /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf
    /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf:413:  #include /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpwhitelist_common.conf;
    /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf:422:  # whitelist php processing access at /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf
    /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf:423:  #include /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpwhitelist_common.conf;
    /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf:432:  # whitelist php processing access at /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf
    /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf:433:  #include /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpwhitelist_common.conf;
    /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf:442:  # whitelist php processing access at /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf
    /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf:443:  #include /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpwhitelist_common.conf;
    /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf:452:  # whitelist php processing access at /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf
    /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpsecure_MYDOMAIN.com.conf:453:  #include /usr/local/nginx/conf/wpincludes/MYDOMAIN.com/wpwhitelist_common.conf;
    cat /usr/local/nginx/conf/pagespeedhandler.conf
    PHP:
    #  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.1allow mypublicipdeny all; }
    location /ngx_pagespeed_global_statistics allow 127.0.0.1allow mypublicipdeny all; }
    location /ngx_pagespeed_message allow 127.0.0.1allow mypublicipdeny all; }
    location /pagespeed_console allow 127.0.0.1allow mypublicipdeny all; }
    location ~ ^/pagespeed_admin allow 127.0.0.1allow mypublicipdeny all; }
    location ~ ^/pagespeed_global_admin allow 127.0.0.1allow mypublicipdeny all; }
     
  10. eva2000

    eva2000 Administrator Staff Member

    45,432
    10,308
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,987
    Local Time:
    1:22 PM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    for the server_name it's literally the server_name text not replacing with your server/domain name
    Code (Text):
    grep -rn -w 'server_name' /usr/local/nginx/conf | egrep -v '\$|localhost|demodomain|backup'
    
     
  11. cr0

    cr0 Member

    38
    4
    8
    Aug 21, 2017
    Ratings:
    +4
    Local Time:
    5:22 AM
    Ah sorry.

    PHP:
    /usr/local/nginx/conf/nginx.conf.default:87:    #    server_name  somename  alias  another.alias;
    /usr/local/nginx/conf/conf.d/virtual.conf:3:            server_name MYDOMAIN.com;
    /
    usr/local/nginx/conf/conf.d/MYDOMAIN.com.conf:9:#            server_name MYDOMAIN.com;
    /usr/local/nginx/conf/conf.d/MYDOMAIN.com.conf:15:  server_name MYDOMAIN.com www.MYDOMAIN.com;
    /
    usr/local/nginx/conf/conf.d/MYDOMAIN.com.ssl.conf:10:#   server_name MYDOMAIN.com www.MYDOMAIN.com;
    /usr/local/nginx/conf/conf.d/MYDOMAIN.com.ssl.conf:16:  server_name MYDOMAIN.com www.MYDOMAIN.com;
    ----

    After setting cloudflare in development mode I got this in pingdom test, from 188 requests to 60 and no errors so far:

    [​IMG]

    Which is kinda neat if it wasn't for the 1.8s load time.

    But then again, in google insights I receive this:

    [​IMG]

    And I'm unsure what to do now :banghead:


    EDIT:
    Those optimization errors seem to be fixed after tweaking the conf:

    PHP:
    pagespeed on;

    pagespeed MapOriginDomain "http://localhost" "https://MYDOMAIN.com";
    pagespeed LoadFromFile "https://MYDOMAIN.com" "/home/nginx/domains/MYDOMAIN.com/public";
    pagespeed LoadFromFile "http://MYDOMAIN.com" "/home/nginx/domains/MYDOMAIN.com/public";

    pagespeed SslCertDirectory /usr/local/nginx/conf/ssl/MYDOMAIN.com;
    pagespeed SslCertFile /usr/local/nginx/conf/ssl/MYDOMAIN.com/public.pem;

    pagespeed Domain http://MYDOMAIN.com;
    pagespeed Domain https://MYDOMAIN.com;
    pagespeed Domain *.MYDOMAIN.com;

    pagespeed MaxSegmentLength 3500;
    pagespeed MaxSegmentLength 3500;

    pagespeed UseExperimentalJsMinifier on;
    pagespeed EnableFilters defer_javascript;
    pagespeed ForceCaching on;

    pagespeed EnableFilters fallback_rewrite_css_urls;
    pagespeed EnableFilters trim_urls;

    #######################################################
    # Purge nginx pagespeed cache
    # https://developers.google.com/speed/pagespeed/module/system#flush_cache
    #######################################################
    pagespeed EnableCachePurge on;
    pagespeed PurgeMethod PURGE;

    #######################################################
    # File cache settings
    ######################################
    # needs to exist and be writable by nginx

    # pagespeed FileCacheSizeKb          102400;
    # pagespeed FileCacheCleanIntervalMs 3600000;
    # pagespeed FileCacheInodeLimit      500000;

    #######################################################
    # By default, ngx_pagespeed adds an X-PageSpeed header with a value of the version of
    # ngx_pagespeed being used. This directive lets you specify the value to use instead:
    # pagespeed XHeaderValue "ngx_pagespeed";

    #######################################################
    # let's speed up PageSpeed by storing it in the super duper fast memcached
    # Ensure Memcached server installed http://centminmod.com/memcached.html
    # default install for centmin mod is on port 11211, so localhost:11211 is correct
    # uncomment - remove hash # in front of below 2 lines to enable
    # timeout set at 100 milliseconds
    pagespeed MemcachedThreads 1;
    pagespeed MemcachedServers "localhost:11211";
    pagespeed MemcachedTimeoutUs 100000;

    #######################################################
    ## 1.11.33.0 beta save-data
    ######################################
    # https://developers.google.com/speed/pagespeed/module/filter-image-optimize#image-quality

    # https://developers.google.com/speed/pagespeed/module/reference-image-optimize#JpegQualityForSaveData
    pagespeed JpegQualityForSaveData 50;

    # https://developers.google.com/speed/pagespeed/module/reference-image-optimize#WebpQualityForSaveData
    pagespeed WebpQualityForSaveData 50;

    #######################################################
    ## 1.7.30.1 beta defaults
    ######################################
    pagespeed PreserveUrlRelativity on;
    pagespeed MaxCombinedCssBytes -1;
    pagespeed ImageResolutionLimitBytes 16777216;
    # pagespeed EnableFilters inline_google_font_css;

    #######################################################
    ## 1.6.29.3 beta defaults
    ######################################
    pagespeed AvoidRenamingIntrospectiveJavascript on;
    pagespeed ImageInlineMaxBytes 3072;
    pagespeed CssImageInlineMaxBytes 0;
    pagespeed MaxInlinedPreviewImagesIndex -1;
    pagespeed MinImageSizeLowResolutionBytes 3072;

    #######################################################
    ## ngx_pagespeed filters settings below ##
    ######################################

      # show half the users an optimized site, half the regular site
      # change UA-XXXXXXXXXX-1 to your GA unique id
      # uncomment - remove hash # in front of below 5 lines to enable
    #  pagespeed RunExperiment on;
    #  pagespeed AnalyticsID UA-XXXXXXXXXX-1;
    #  pagespeed ExperimentVariable 1;
    #  pagespeed ExperimentSpec "id=1;percent=50;level=CoreFilters;enabled=collapse_whitespace,remove_comments;";
    #  pagespeed ExperimentSpec "id=2;percent=50";
     
      # Filter settings
      # filters outlined at http://ngxpagespeed.com/ngx_pagespeed_example/
      
    pagespeed RewriteLevel CoreFilters;
      
    pagespeed EnableFilters collapse_whitespace,remove_comments;

      
    # make_google_analytics_async
      # https://developers.google.com/speed/docs/mod_pagespeed/filter-make-google-analytics-async
    #  pagespeed EnableFilters make_google_analytics_async;

      # make_show_ads_async
      # https://developers.google.com/speed/pagespeed/module/filter-make-show-ads-async
    #  pagespeed EnableFilters make_show_ads_async;

      # responsive_images, responsive_images_zoom
      # https://developers.google.com/speed/pagespeed/module/filter-image-responsive
    #  pagespeed EnableFilters responsive_images;
    #  pagespeed EnableFilters responsive_images_zoom;

      # convert_to_webp_animated
      # https://developers.google.com/speed/pagespeed/module/filter-image-optimize#convert_to_webp_animated
      
    pagespeed EnableFilters convert_to_webp_animated;

      
    # inline_google_font_css
      # https://developers.google.com/speed/pagespeed/module/filter-css-inline-google-fonts
      
    pagespeed EnableFilters inline_google_font_css;
      
    # require FetchHttps if using https site
       
    pagespeed FetchHttps disable;

      
    # inline_css
      # https://developers.google.com/speed/pagespeed/module/filter-css-inline
    pagespeed EnableFilters inline_css;
     
    pagespeed CssInlineMaxBytes 5048;

      
    # prioritize_critical_css
      # https://developers.google.com/speed/docs/mod_pagespeed/filter-prioritize-critical-css
       
    pagespeed EnableFilters prioritize_critical_css;

      
    # move_css_to_head
      # https://developers.google.com/speed/docs/mod_pagespeed/filter-css-to-head
      
    pagespeed EnableFilters move_css_to_head;

      
    # move_css_above_scripts
      # https://developers.google.com/speed/docs/mod_pagespeed/filter-css-above-scripts
      
    pagespeed EnableFilters move_css_above_scripts;

      
    # combine_css
      # https://developers.google.com/speed/docs/mod_pagespeed/filter-css-combine
    pagespeed EnableFilters combine_css;

       
    # Uncomment this if you want to prevent mod_pagespeed from combining files
       # (e.g. CSS files) across paths
       #
    #  pagespeed CombineAcrossPaths off;

      # combine_javascript
      # https://developers.google.com/speed/docs/mod_pagespeed/filter-js-combine
      
    pagespeed EnableFilters combine_javascript;
      
    pagespeed MaxCombinedJsBytes 150000;

      
    # extend_cache
      # https://developers.google.com/speed/docs/mod_pagespeed/filter-cache-extend
    pagespeed EnableFilters extend_cache;

      
    # rewrite_css
      # https://developers.google.com/speed/docs/mod_pagespeed/filter-css-rewrite
     #pagespeed EnableFilters rewrite_css;

      # rewrite_javascript
      # https://developers.google.com/speed/docs/mod_pagespeed/filter-js-minify
    pagespeed EnableFilters rewrite_javascript;

      
    # inline_preview_images
      # https://developers.google.com/speed/pagespeed/module/filter-inline-preview-images
      
    pagespeed EnableFilters inline_preview_images;

      
    # lazyload_images
      # https://developers.google.com/speed/docs/mod_pagespeed/filter-lazyload-images
      
    pagespeed EnableFilters lazyload_images;

      
    # rewrite_images
      # https://developers.google.com/speed/docs/mod_pagespeed/filter-image-optimize
      
    pagespeed EnableFilters rewrite_images;
       
    pagespeed EnableFilters recompress_images;
       
    pagespeed DisableFilters convert_png_to_jpeg;
       
    pagespeed DisableFilters extend_cache_images;
       
    pagespeed EnableFilters convert_jpeg_to_progressive;
    #  pagespeed EnableFilters convert_png_to_jpeg;
      
    pagespeed EnableFilters convert_jpeg_to_webp;
      
    pagespeed EnableFilters convert_to_webp_lossless;

      
    # sprite_images
      # https://developers.google.com/speed/docs/mod_pagespeed/filter-image-sprite
     
    pagespeed EnableFilters rewrite_css,sprite_images;

      
    # insert_dns_prefetch
      # https://developers.google.com/speed/docs/mod_pagespeed/filter-insert-dns-prefetch
    #  pagespeed EnableFilters insert_dns_prefetch;

      # InPlaceResourceOptimization
      # https://developers.google.com/speed/pagespeed/module/system#ipro
      # Enabled by default as of 1.9.32.1
      
    pagespeed InPlaceResourceOptimization off;

    #######################################################
     
    Last edited: Sep 11, 2017
  12. eva2000

    eva2000 Administrator Staff Member

    45,432
    10,308
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,987
    Local Time:
    1:22 PM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    for conflicting hostname, there's problem main hostname's server_name needs to be main hostname not domain name
    Code (Text):
    /usr/local/nginx/conf/conf.d/virtual.conf:3:            server_name MYDOMAIN.com;
    

    as per step 1 of getting started guide and summary at bottom
     
  13. eva2000

    eva2000 Administrator Staff Member

    45,432
    10,308
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,987
    Local Time:
    1:22 PM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    can't do much about blocking js resources if your web app needs them in a particular order so leave as is you manually need to work with web app and theme's developments to improve it
     
  14. eva2000

    eva2000 Administrator Staff Member

    45,432
    10,308
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,987
    Local Time:
    1:22 PM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    one thing you can try in pagespeed.conf is enable the move_css_above_scripts and move_css_to_head filters
    Code (Text):
      # move_css_to_head
      # https://developers.google.com/speed/docs/mod_pagespeed/filter-css-to-head
      pagespeed EnableFilters move_css_to_head;
    
      # move_css_above_scripts
      # https://developers.google.com/speed/docs/mod_pagespeed/filter-css-above-scripts
      pagespeed EnableFilters move_css_above_scripts;
    

    then restart nginx
     
  15. cr0

    cr0 Member

    38
    4
    8
    Aug 21, 2017
    Ratings:
    +4
    Local Time:
    5:22 AM
    Yep. Added them too. Everything is neat for now. The loading time is a bit long though (2.8sec to load 1MB) and there're few resources that don't minify still, plus caching headers aren't working at all and I can't access the pagespeed admin page (probably because of vhost configuration).

    I see. My fault, thank you. Is it possible to find the hostname.domain.com after creating the vhost so I don't have to uninstall anything? Because everything I got after running uname -n is the main domain name MYDOMAIN.com I'm using, without the subdomain prefix.

    I will explain the steps I'm going to take further (because I don't understand well the steps outlined in that guide, feels bad to be a rookie) to use MYDOMAIN.com if there's no solution, so you can verify.
    1. Fresh install
    2. Find out the VPS hostname of digitalocean through uname-n
    3. In CloudFlare DNS, instead of MYDOMAIN.com, I would add hostname.MYDOMAIN.com pointing to server's IP
    4. Then I would proceed to create a vhost with the main domain - MYDOMAIN.com
    Is this right?
     
  16. eva2000

    eva2000 Administrator Staff Member

    45,432
    10,308
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,987
    Local Time:
    1:22 PM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    No need to reinstall server. Only you would need to change the main hostname for server then, see getting started step 1 as it outlines how you can change main hostname too and then just edit virtual.conf vhost with the updated new main hostname

    then update dns
    yup

    Digitalocean console might have the hostname there if you set it there ?
     
  17. eva2000

    eva2000 Administrator Staff Member

    45,432
    10,308
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,987
    Local Time:
    1:22 PM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    yes probably why, once you fix virtual.conf and server main hostname, should be able to access it from new updated main hostname
     
  18. cr0

    cr0 Member

    38
    4
    8
    Aug 21, 2017
    Ratings:
    +4
    Local Time:
    5:22 AM
    I think I did it right, but the mainpage isn't loading - MYDOMAIN.com's server DNS address could not be found.

    I followed the guide you provided:
    1. In ssh hostnamectl set-hostname hostname.MYDOMAIN.com
    2. In ssh sudo nano /etc/hosts and added svpublicIP hostname.MYDOMAIN.com
    3. In ssh sudo nano /etc/hostname and added hostname.newdomain.com
    4. In ssh hostname hostname.newdomain.com + service network restart
    5. In ssh vhostconf then changed to server_name hostname.MYDOMAIN.com;
    6. In ssh /etc/init.d/nginx restart
    7. In cloudflare I got 1 entry of TYPE A pointing to server's public IP (which is a subdomain): hostname
    8. In one and only vhost conf's I got (normal + SSL), server name is set to MYDOMAIN.com
    9. No result.
    Code:
    # Your system has configured 'manage_etc_hosts' as True.
    # As a result, if you wish for changes to this file to persist
    # then you will need to either
    # a.) make changes to the master file in /etc/cloud/templates/hosts.tmpl
    # b.) change or remove the value of 'manage_etc_hosts' in
    #     /etc/cloud/cloud.cfg or cloud-config from user-data
    127.0.1.1 PREVIOUS HOSTNAME ADDED HERE AS "MYDOMAIN.com MYDOMAIN.com"
    127.0.0.1 localhost
    SERVERPUBLICIP hostname.MYDOMAIN.com
    
    # The following lines are desirable for IPv6 capable hosts
    ::1 ip6-localhost ip6-loopback
    fe00::0 ip6-localnet
    ff00::0 ip6-mcastprefix
    ff02::1 ip6-allnodes
    ff02::2 ip6-allrouters
    ff02::3 ip6-allhosts
    
    Tried to remove the
    Code:
    127.0.1.1 PREVIOUS HOSTNAME ADDED HERE AS "MYDOMAIN.com MYDOMAIN.com" (because the droplet was named as MYDOMAIN.com)
    No result, then I tried to remove the SERVERPUBLICIP hostname.MYDOMAIN.com and replacing the "MYDOMAIN.com MYDOMAIN.com" like this:
    PHP:
    127.0.1.1 hostname.MYDOMAIN.com
    127.0.0.1 localhost
    Rebooting everything of course. No result!

    Let's wait, maybe it has to update, but it's been half an hour already.

    The output of hostnamectl status is

    Code:
       Static hostname: hostname.MYDOMAIN.com
             Icon name: computer-vm
               Chassis: vm
            Machine ID: fe0758279faa4792228cd0093de78ad9
               Boot ID: 37276e6d5c557f98bb08f59e7920440d
        Virtualization: kvm
      Operating System: CentOS Linux 7 (Core)
           CPE OS Name: cpe:/o:centos:centos:7
                Kernel: Linux 3.10.0-514.26.2.el7.x86_64
          Architecture: x86-64
    
    Here's what I got in cloudflare (where name it's hostname):

    [​IMG]

    Also tried this setup, where est (2nd line) is the hostname and 1st blurred line is the "@" entry:
    [​IMG]

    NEVERMIND, IT'S WORKING NOW. No warnings related to vhost. :)
     
    Last edited: Sep 12, 2017
  19. eva2000

    eva2000 Administrator Staff Member

    45,432
    10,308
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,987
    Local Time:
    1:22 PM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    with all the masked entries hard to see what's going on there

    you don't need to delete any DNS records, just add a DNS A record for
    hostname.MYDOMAIN.com would would of just been

    A hostname points to server IP
     
  20. cr0

    cr0 Member

    38
    4
    8
    Aug 21, 2017
    Ratings:
    +4
    Local Time:
    5:22 AM
    Thank you. Yep, got it working (just had to wait). Still can't connect to admin page though and staticfiles.conf isn't working (cloudflare set to development mode).

    What's strange is that if I uncomment pagespeed includes from vhost conf's, it's working! But PageSpeed Console isn't working then. Only if I uncomment the 3rd #:

    Code:
    include /usr/local/nginx/conf/pagespeedstatslog.conf;
    No warnings when using nginx-t