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

Wordpress Gravatars and Nginx, Help..

Discussion in 'Blogs & CMS usage' started by Jesus Higuerey, Aug 31, 2018.

  1. Jesus Higuerey

    Jesus Higuerey New Member

    25
    0
    1
    Aug 26, 2018
    Ratings:
    +1
    Local Time:
    10:35 AM
    Hi,

    So I found this guide which pretty much says how to pull gravatars from your server instead of their servers. (LINK)

    I added the following code to my vhost but is giving me an error..
    Code:
    Line 24: location  / {
    sub_filter 'https://secure.gravatar.com/avatar/' 'https://domain.com/avatar/';
    sub_filter_once off;
    }
    
    
    location /avatar {
    proxy_pass https://secure.gravatar.com$request_uri;
    }
    
    The error is:
    Code:
    nginx: [emerg] duplicate location "/" in /etc/nginx/sites-enabled/domain.com:24
    nginx: configuration file /etc/nginx/nginx.conf test failed
    
    Line 24 is the beginning of the previous code "location / { "

    Any clues on what might be happening?
     
  2. eva2000

    eva2000 Administrator Staff Member

    37,237
    8,134
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,524
    Local Time:
    4:35 AM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    When you create a new nginx vhost domain via centmin.sh menu option 2 or menu option 22 or via /usr/bin/nv cli command line, you will create the Nginx vhost files and directories. You will get an outputted the path location where it will create the domain name's vhost conf file named newdomain.com.conf (and newdomain.com.ssl.conf if you selected yes to self signed SSL)
    • Nginx vhost conf path will be at /usr/local/nginx/conf/conf.d/newdomain.com.conf
    • Nginx HTTP/2 SSL vhost conf path will be at /usr/local/nginx/conf/conf.d/newdomain.com.ssl.conf
    • Nginx Self-Signed SSL Certificate Directory at /usr/local/nginx/conf/ssl/newdomain.com
    • Vhost public web root will be at /home/nginx/domains/newdomain.com/public
    • Vhost log directory will be at /home/nginx/domains/newdomain.com/log
    Please post the contents of /usr/local/nginx/conf/conf.d/newdomain.com.conf and if applicable /usr/local/nginx/conf/conf.d/newdomain.com.ssl.conf wrapped in CODE tags (outlined at How to use forum BBCODE code tags)

    what is output of these commands in ssh
    Code (Text):
    curl -I https://domain.com
    

    Code (Text):
    curl -I https://www.domain.com
    

    Code (Text):
    curl -I http://domain.com
    

    Code (Text):
    curl -I http://www.domain.com
    

    wrap output in CODE tags
     
    • Like Like x 1
  3. Jesus Higuerey

    Jesus Higuerey New Member

    25
    0
    1
    Aug 26, 2018
    Ratings:
    +1
    Local Time:
    10:35 AM
    Hey, thanks for answering. As of right now just did a fresh install of centos, in a couple mins Ill be able to install centmin, once I create a vhost Ill post what you asked...

    Thank you!
     
  4. Jesus Higuerey

    Jesus Higuerey New Member

    25
    0
    1
    Aug 26, 2018
    Ratings:
    +1
    Local Time:
    10:35 AM
    Hello,
    Here is the result of curl -I domain..
    Code:
    HTTP/1.1 200 OK
    Date: Thu, 30 Aug 2018 18:23:27 GMT
    Content-Type: text/html; charset=UTF-8
    Connection: keep-alive
    Vary: Accept-Encoding
    Link: <http://host.domain.com/wp-json/>; rel="https://api.w.org/"
    Server: nginx centminmod
    X-Powered-By: centminmod
    X-Xss-Protection: 1; mode=block
    X-Content-Type-Options: nosniff
    
    The content of the vhost of the site
    Code:
    # Centmin Mod Getting Started Guide
    # must read http://centminmod.com/getstarted.html
    
    # redirect from non-www to www
    # uncomment, save file and restart Nginx to enable
    # if unsure use return 302 before using return 301
    #server {
    #            listen   80;
    #            server_name domain.com;
    #            return 301 $scheme://www.domain.com$request_uri;
    #       }
    
    server {
    
      server_name domain.com www.domain.com;
    
    # 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;
    
      #add_header X-Frame-Options SAMEORIGIN;
      add_header X-Xss-Protection "1; mode=block" always;
      add_header X-Content-Type-Options "nosniff" always;
      #add_header Referrer-Policy "strict-origin-when-cross-origin";
    
      # limit_conn limit_per_ip 16;
      # ssi  on;
    
      access_log /home/nginx/domains/domain.com/log/access.log combined buffer=256k flush=5m;
      error_log /home/nginx/domains/domain.com/log/error.log;
    
      include /usr/local/nginx/conf/autoprotect/domain.com/autoprotect-domain.com.conf;
      root /home/nginx/domains/domain.com/public;
      # uncomment cloudflare.conf include if using cloudflare for
      # server and/or vhost site
      #include /usr/local/nginx/conf/cloudflare.conf;
      include /usr/local/nginx/conf/503include-main.conf;
    
      include /usr/local/nginx/conf/wpincludes/domain.com/wpcacheenabler_domain.com.conf;
      #include /usr/local/nginx/conf/wpincludes/domain.com/wpsupercache_domain.com.conf;
      # https://community.centminmod.com/posts/18828/
      #include /usr/local/nginx/conf/wpincludes/domain.com/rediscache_domain.com.conf;
    
      location / {
      include /usr/local/nginx/conf/503include-only.conf;
    
    
      # Enables directory listings when index file not found
      #autoindex  on;
    
      # for wordpress super cache plugin
      #try_files /wp-content/cache/supercache/$http_host/$cache_uri/index.html $uri $uri/ /index.php?q=$uri&$args;
    
      # for wp cache enabler plugin
      try_files $cache_enabler_uri $uri $uri/ $custom_subdir/index.php?$args;
    
      # Wordpress Permalinks
     #try_files $uri $uri/ /index.php?q=$uri&$args;
    
      # Nginx level redis Wordpress
      # https://community.centminmod.com/posts/18828/
      #try_files $uri $uri/ /index.php?$args;
    
      }
    
    location ~* /(wp-login\.php) {
        limit_req zone=xwplogin burst=1 nodelay;
        #limit_conn xwpconlimit 30;
        auth_basic "Private";
        auth_basic_user_file /home/nginx/domains/domain.com/htpasswd_wplogin;
        include /usr/local/nginx/conf/php-wpsc.conf;
    
        # https://community.centminmod.com/posts/18828/
        #include /usr/local/nginx/conf/php-rediscache.conf;
    }
    
    location ~* /(xmlrpc\.php) {
        limit_req zone=xwprpc burst=45 nodelay;
        #limit_conn xwpconlimit 30;
        include /usr/local/nginx/conf/php-wpsc.conf;
    
        # https://community.centminmod.com/posts/18828/
        #include /usr/local/nginx/conf/php-rediscache.conf;
    }
    
    location ~* /wp-admin/(load-scripts\.php) {
        limit_req zone=xwprpc burst=5 nodelay;
        #limit_conn xwpconlimit 30;
        include /usr/local/nginx/conf/php-wpsc.conf;
    
        # https://community.centminmod.com/posts/18828/
        #include /usr/local/nginx/conf/php-rediscache.conf;
    }
    
    location ~* /wp-admin/(load-styles\.php) {
        limit_req zone=xwprpc burst=5 nodelay;
        #limit_conn xwpconlimit 30;
        include /usr/local/nginx/conf/php-wpsc.conf;
    
        # https://community.centminmod.com/posts/18828/
        #include /usr/local/nginx/conf/php-rediscache.conf;
    }
    
      include /usr/local/nginx/conf/wpincludes/domain.com/wpsecure_domain.com.conf;
      include /usr/local/nginx/conf/php-wpsc.conf;
    
      # https://community.centminmod.com/posts/18828/
      #include /usr/local/nginx/conf/php-rediscache.conf;
    
      include /usr/local/nginx/conf/staticfiles.conf;
      include /usr/local/nginx/conf/drop.conf;
      #include /usr/local/nginx/conf/errorpage.conf;
      include /usr/local/nginx/conf/vts_server.conf;
    }
    Since this is a fresh instalation, I have not added the code I want to add, since whatever I try it gives me an error so..
     
  5. eva2000

    eva2000 Administrator Staff Member

    37,237
    8,134
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,524
    Local Time:
    4:35 AM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    i suspect you added 2nd location / context to your vhost.

    Your existing location web root / context is already in your vhost at
    Code (Text):
      location / {
      include /usr/local/nginx/conf/503include-only.conf;
    
      # Enables directory listings when index file not found
      #autoindex  on;
    
      # for wordpress super cache plugin
      #try_files /wp-content/cache/supercache/$http_host/$cache_uri/index.html $uri $uri/ /index.php?q=$uri&$args;
    
      # for wp cache enabler plugin
      try_files $cache_enabler_uri $uri $uri/ $custom_subdir/index.php?$args;
    
      # Wordpress Permalinks
     #try_files $uri $uri/ /index.php?q=$uri&$args;
    
      # Nginx level redis Wordpress
      # https://community.centminmod.com/posts/18828/
      #try_files $uri $uri/ /index.php?$args;
    
      }
    

    So the additional web root location / context you need to add goes in there so changes to
    Code (Text):
      location / {
      include /usr/local/nginx/conf/503include-only.conf;
    
      sub_filter 'https://secure.gravatar.com/avatar/' 'https://domain.com/avatar/';
      sub_filter_once off;
    
      # Enables directory listings when index file not found
      #autoindex  on;
    
      # for wordpress super cache plugin
      #try_files /wp-content/cache/supercache/$http_host/$cache_uri/index.html $uri $uri/ /index.php?q=$uri&$args;
    
      # for wp cache enabler plugin
      try_files $cache_enabler_uri $uri $uri/ $custom_subdir/index.php?$args;
    
      # Wordpress Permalinks
     #try_files $uri $uri/ /index.php?q=$uri&$args;
    
      # Nginx level redis Wordpress
      # https://community.centminmod.com/posts/18828/
      #try_files $uri $uri/ /index.php?$args;
    
      }
    
     
  6. Jesus Higuerey

    Jesus Higuerey New Member

    25
    0
    1
    Aug 26, 2018
    Ratings:
    +1
    Local Time:
    10:35 AM
    Hello,

    Sorry I am kinda new to all of this. So the first code will go to the second part you mentioned? If yes, the second code "location /avatar " will go outside of it since is targeting the "Avatar" folder?

    Again, sorry for being such a newbie in this
     
  7. eva2000

    eva2000 Administrator Staff Member

    37,237
    8,134
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,524
    Local Time:
    4:35 AM
    Nginx 1.15.x
    MariaDB 5.5/10.x
  8. Jesus Higuerey

    Jesus Higuerey New Member

    25
    0
    1
    Aug 26, 2018
    Ratings:
    +1
    Local Time:
    10:35 AM
    I did that, restarted nginx, everything ok.. Thing is, it doesn't seem to work, I am still getting gravatars served from their servers.

    The settings look like this
    Code:
      location / {
      include /usr/local/nginx/conf/503include-only.conf;
    
      sub_filter 'https://secure.gravatar.com/avatar/' 'https://domain.com/avatar/';
      sub_filter_once off;
    
      # Enables directory listings when index file not found
      #autoindex  on;
    
      # for wordpress super cache plugin
      #try_files /wp-content/cache/supercache/$http_host/$cache_uri/index.html $uri $uri/ /index.php?q=$uri&$args;
    
      # for wp cache enabler plugin
      try_files $cache_enabler_uri $uri $uri/ $custom_subdir/index.php?$args;
    
      # Wordpress Permalinks
      #try_files $uri $uri/ /index.php?q=$uri&$args;
    
      # Nginx level redis Wordpress
      # https://community.centminmod.com/posts/18828/
      #try_files $uri $uri/ /index.php?$args;
    
      }
    
     location /avatar {
     proxy_pass https://secure.gravatar.com$request_uri;
    }
    
     
  9. eva2000

    eva2000 Administrator Staff Member

    37,237
    8,134
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,524
    Local Time:
    4:35 AM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    try moving sub_filter directives out of location web root / context and above it

    so becomes
    Code (Text):
      sub_filter 'https://secure.gravatar.com/avatar/' 'https://domain.com/avatar/';
      sub_filter_once off;
    
      location / {
      include /usr/local/nginx/conf/503include-only.conf;
    
      # Enables directory listings when index file not found
      #autoindex  on;
    
      # for wordpress super cache plugin
      #try_files /wp-content/cache/supercache/$http_host/$cache_uri/index.html $uri $uri/ /index.php?q=$uri&$args;
    
      # for wp cache enabler plugin
      try_files $cache_enabler_uri $uri $uri/ $custom_subdir/index.php?$args;
    
      # Wordpress Permalinks
     #try_files $uri $uri/ /index.php?q=$uri&$args;
    
      # Nginx level redis Wordpress
      # https://community.centminmod.com/posts/18828/
      #try_files $uri $uri/ /index.php?$args;
    
      }
    
     
  10. eva2000

    eva2000 Administrator Staff Member

    37,237
    8,134
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,524
    Local Time:
    4:35 AM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    or also clearing cache enabler cache
     
  11. Jesus Higuerey

    Jesus Higuerey New Member

    25
    0
    1
    Aug 26, 2018
    Ratings:
    +1
    Local Time:
    10:35 AM
    Moved the two lines like you said, nginx reload was fine, cleared cache, still nothing..
     
  12. eva2000

    eva2000 Administrator Staff Member

    37,237
    8,134
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,524
    Local Time:
    4:35 AM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    try moving the 2 lines back to previously placement + clear cache and restart nginx
     
  13. Jesus Higuerey

    Jesus Higuerey New Member

    25
    0
    1
    Aug 26, 2018
    Ratings:
    +1
    Local Time:
    10:35 AM
    Still no luck :S
     
  14. eva2000

    eva2000 Administrator Staff Member

    37,237
    8,134
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,524
    Local Time:
    4:35 AM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    It's quite possible Cache Enabler via Centmin Mod centmin.sh menu option 22 is interfering as it enables advanced caching at Nginx level which may cache the file before nginx sub filter can apply to it

    You can verify this by disabling cache enabler temporarily by changing try_files directive from cache enabler version to standard wp one by changing
    Code (Text):
      # for wp cache enabler plugin
      try_files $cache_enabler_uri $uri $uri/ $custom_subdir/index.php?$args;
    
      # Wordpress Permalinks
     #try_files $uri $uri/ /index.php?q=$uri&$args;
    

    to comment out/disable cache enabler version and uncomment (remove hash #) from standard wp try_files
    Code (Text):
      # for wp cache enabler plugin
      #try_files $cache_enabler_uri $uri $uri/ $custom_subdir/index.php?$args;
    
      # Wordpress Permalinks
     try_files $uri $uri/ /index.php?q=$uri&$args;
    

    restart nginx

    see if sub_filter works then to confirm if cache enabler advanced caching is preventing it from working
     
  15. Jesus Higuerey

    Jesus Higuerey New Member

    25
    0
    1
    Aug 26, 2018
    Ratings:
    +1
    Local Time:
    10:35 AM
    Did that, but with not luck, still the same..

    Also found this "guide" which is basically the same thing, (LINK) and his gravatars are being loaded from his cdn..

    You lost me on this:
    Code:
    see if sub_filter works then to confirm if cache enabler advanced caching is preventing it from working
    
     
  16. eva2000

    eva2000 Administrator Staff Member

    37,237
    8,134
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,524
    Local Time:
    4:35 AM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    if you tried the switch to below with cache enabler disabled and still doesn't work then it isn't cache enabler that is the problem
    Code (Text):
      # for wp cache enabler plugin
      #try_files $cache_enabler_uri $uri $uri/ $custom_subdir/index.php?$args;
    
      # Wordpress Permalinks
     try_files $uri $uri/ /index.php?q=$uri&$args;
    


    so switch it back to previous
    Code (Text):
      # for wp cache enabler plugin
      try_files $cache_enabler_uri $uri $uri/ $custom_subdir/index.php?$args;
    
      # Wordpress Permalinks
     #try_files $uri $uri/ /index.php?q=$uri&$args;
    

    post the contents of your current nginx vhost /usr/local/nginx/conf/conf.d/yourdomain.com.conf using SSH command cat to output it's contents
    Code (Text):
    cat /usr/local/nginx/conf/conf.d/yourdomain.com.conf
    
     
  17. Jesus Higuerey

    Jesus Higuerey New Member

    25
    0
    1
    Aug 26, 2018
    Ratings:
    +1
    Local Time:
    10:35 AM
    Here you go :)

    Code:
    [21:29][[email protected] conf.d]# cat /usr/local/nginx/conf/conf.d/domain.com.conf
    # Centmin Mod Getting Started Guide
    # must read http://centminmod.com/getstarted.html
    
    # redirect from non-www to www
    # uncomment, save file and restart Nginx to enable
    # if unsure use return 302 before using return 301
    #server {
    #            listen   80;
    #            server_name domain.com;
    #            return 301 $scheme://www.domain.com$request_uri;
    #       }
    
    server {
    
      server_name domain.com www.domain.com;
    
    # 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;
    
      #add_header X-Frame-Options SAMEORIGIN;
      add_header X-Xss-Protection "1; mode=block" always;
      add_header X-Content-Type-Options "nosniff" always;
      #add_header Referrer-Policy "strict-origin-when-cross-origin";
    
      # limit_conn limit_per_ip 16;
      # ssi  on;
    
      access_log /home/nginx/domains/domain.com/log/access.log combined buffer=256k flush=5m;
      error_log /home/nginx/domains/domain.com/log/error.log;
    
      include /usr/local/nginx/conf/autoprotect/domain.com/autoprotect-domain.com.conf;
      root /home/nginx/domains/domain.com/public;
      # uncomment cloudflare.conf include if using cloudflare for
      # server and/or vhost site
      #include /usr/local/nginx/conf/cloudflare.conf;
      include /usr/local/nginx/conf/503include-main.conf;
    
      include /usr/local/nginx/conf/wpincludes/domain.com/wpcacheenabler_domain.com.conf;
      #include /usr/local/nginx/conf/wpincludes/domain.com/wpsupercache_domain.com.conf;
      # https://community.centminmod.com/posts/18828/
      #include /usr/local/nginx/conf/wpincludes/domain.com/rediscache_domain.com.conf;
    
    
    
      location / {
      include /usr/local/nginx/conf/503include-only.conf;
    
      sub_filter 'https://secure.gravatar.com/avatar/' 'https://domain.com/avatar/';
      sub_filter_once off;
      # Enables directory listings when index file not found
      #autoindex  on;
    
      # for wordpress super cache plugin
      #try_files /wp-content/cache/supercache/$http_host/$cache_uri/index.html $uri $uri/ /index.php?q=$uri&$args;
    
      # for wp cache enabler plugin
       try_files $cache_enabler_uri $uri $uri/ $custom_subdir/index.php?$args;
    
      # Wordpress Permalinks
      #try_files $uri $uri/ /index.php?q=$uri&$args;
    
      # Nginx level redis Wordpress
      # https://community.centminmod.com/posts/18828/
      #try_files $uri $uri/ /index.php?$args;
    
      }
    
     location /avatar {
     proxy_pass https://secure.gravatar.com$request_uri;
    }
    
    location ~* /(wp-login\.php) {
        limit_req zone=xwplogin burst=1 nodelay;
        #limit_conn xwpconlimit 30;
        auth_basic "Private";
        auth_basic_user_file /home/nginx/domains/domain.com/htpasswd_wplogin;
        include /usr/local/nginx/conf/php-wpsc.conf;
    
        # https://community.centminmod.com/posts/18828/
        #include /usr/local/nginx/conf/php-rediscache.conf;
    }
    
    location ~* /(xmlrpc\.php) {
        limit_req zone=xwprpc burst=45 nodelay;
        #limit_conn xwpconlimit 30;
        include /usr/local/nginx/conf/php-wpsc.conf;
    
        # https://community.centminmod.com/posts/18828/
        #include /usr/local/nginx/conf/php-rediscache.conf;
    }
    
    location ~* /wp-admin/(load-scripts\.php) {
        limit_req zone=xwprpc burst=5 nodelay;
        #limit_conn xwpconlimit 30;
        include /usr/local/nginx/conf/php-wpsc.conf;
    
        # https://community.centminmod.com/posts/18828/
        #include /usr/local/nginx/conf/php-rediscache.conf;
    }
    
    location ~* /wp-admin/(load-styles\.php) {
        limit_req zone=xwprpc burst=5 nodelay;
        #limit_conn xwpconlimit 30;
        include /usr/local/nginx/conf/php-wpsc.conf;
    
        # https://community.centminmod.com/posts/18828/
        #include /usr/local/nginx/conf/php-rediscache.conf;
    }
    
      include /usr/local/nginx/conf/wpincludes/domain.com/wpsecure_domain.com.conf;
      include /usr/local/nginx/conf/php-wpsc.conf;
    
      # https://community.centminmod.com/posts/18828/
      #include /usr/local/nginx/conf/php-rediscache.conf;
    
      include /usr/local/nginx/conf/staticfiles.conf;
      include /usr/local/nginx/conf/drop.conf;
      #include /usr/local/nginx/conf/errorpage.conf;
      include /usr/local/nginx/conf/vts_server.conf;
    }
    [21:29][[email protected] conf.d]#
    
     
  18. eva2000

    eva2000 Administrator Staff Member

    37,237
    8,134
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,524
    Local Time:
    4:35 AM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    believe i figured out your issue, you need to move the sub_filters higher up into the vhost just below root path directive and move proxy above location web root / context and also add sub_filter_last_modified on directive for better caching. That will get sub_filter working

    Code (Text):
    # Centmin Mod Getting Started Guide
    # must read http://centminmod.com/getstarted.html
    
    # redirect from non-www to www
    # uncomment, save file and restart Nginx to enable
    # if unsure use return 302 before using return 301
    #server {
    #            listen   80;
    #            server_name domain.com;
    #            return 301 $scheme://www.domain.com$request_uri;
    #       }
    
    server {
    
      server_name domain.com www.domain.com;
    
    # 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;
    
      #add_header X-Frame-Options SAMEORIGIN;
      add_header X-Xss-Protection "1; mode=block" always;
      add_header X-Content-Type-Options "nosniff" always;
      #add_header Referrer-Policy "strict-origin-when-cross-origin";
    
      # limit_conn limit_per_ip 16;
      # ssi  on;
    
      access_log /home/nginx/domains/domain.com/log/access.log combined buffer=256k flush=5m;
      error_log /home/nginx/domains/domain.com/log/error.log;
    
      include /usr/local/nginx/conf/autoprotect/domain.com/autoprotect-domain.com.conf;
      root /home/nginx/domains/domain.com/public;
    
      sub_filter 'https://secure.gravatar.com/avatar/' 'https://domain.com/avatar/';
      sub_filter_last_modified on;
      sub_filter_once off;
    
      # uncomment cloudflare.conf include if using cloudflare for
      # server and/or vhost site
      #include /usr/local/nginx/conf/cloudflare.conf;
      include /usr/local/nginx/conf/503include-main.conf;
    
      include /usr/local/nginx/conf/wpincludes/domain.com/wpcacheenabler_domain.com.conf;
      #include /usr/local/nginx/conf/wpincludes/domain.com/wpsupercache_domain.com.conf;
      # https://community.centminmod.com/posts/18828/
      #include /usr/local/nginx/conf/wpincludes/domain.com/rediscache_domain.com.conf;
    
      location /avatar {
       proxy_pass https://secure.gravatar.com$request_uri;
      }
    
      location / {
      include /usr/local/nginx/conf/503include-only.conf;
    
      # Enables directory listings when index file not found
      #autoindex  on;
    
      # for wordpress super cache plugin
      #try_files /wp-content/cache/supercache/$http_host/$cache_uri/index.html $uri $uri/ /index.php?q=$uri&$args;
    
      # for wp cache enabler plugin
       try_files $cache_enabler_uri $uri $uri/ $custom_subdir/index.php?$args;
    
      # Wordpress Permalinks
      #try_files $uri $uri/ /index.php?q=$uri&$args;
    
      # Nginx level redis Wordpress
      # https://community.centminmod.com/posts/18828/
      #try_files $uri $uri/ /index.php?$args;
    
      }
    
    location ~* /(wp-login\.php) {
       limit_req zone=xwplogin burst=1 nodelay;
       #limit_conn xwpconlimit 30;
       auth_basic "Private";
       auth_basic_user_file /home/nginx/domains/domain.com/htpasswd_wplogin;
       include /usr/local/nginx/conf/php-wpsc.conf;
    
       # https://community.centminmod.com/posts/18828/
       #include /usr/local/nginx/conf/php-rediscache.conf;
    }
    
    location ~* /(xmlrpc\.php) {
       limit_req zone=xwprpc burst=45 nodelay;
       #limit_conn xwpconlimit 30;
       include /usr/local/nginx/conf/php-wpsc.conf;
    
       # https://community.centminmod.com/posts/18828/
       #include /usr/local/nginx/conf/php-rediscache.conf;
    }
    
    location ~* /wp-admin/(load-scripts\.php) {
       limit_req zone=xwprpc burst=5 nodelay;
       #limit_conn xwpconlimit 30;
       include /usr/local/nginx/conf/php-wpsc.conf;
    
       # https://community.centminmod.com/posts/18828/
       #include /usr/local/nginx/conf/php-rediscache.conf;
    }
    
    location ~* /wp-admin/(load-styles\.php) {
       limit_req zone=xwprpc burst=5 nodelay;
       #limit_conn xwpconlimit 30;
       include /usr/local/nginx/conf/php-wpsc.conf;
    
       # https://community.centminmod.com/posts/18828/
       #include /usr/local/nginx/conf/php-rediscache.conf;
    }
    
      include /usr/local/nginx/conf/wpincludes/domain.com/wpsecure_domain.com.conf;
      include /usr/local/nginx/conf/php-wpsc.conf;
    
      # https://community.centminmod.com/posts/18828/
      #include /usr/local/nginx/conf/php-rediscache.conf;
    
      include /usr/local/nginx/conf/staticfiles.conf;
      include /usr/local/nginx/conf/drop.conf;
      #include /usr/local/nginx/conf/errorpage.conf;
      include /usr/local/nginx/conf/vts_server.conf;
    }
    
     
  19. Jesus Higuerey

    Jesus Higuerey New Member

    25
    0
    1
    Aug 26, 2018
    Ratings:
    +1
    Local Time:
    10:35 AM
    Hey, thanks for the effort, but yet again doesn't seem to work. Made sure to delete all cache, but still..
     
  20. eva2000

    eva2000 Administrator Staff Member

    37,237
    8,134
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +12,524
    Local Time:
    4:35 AM
    Nginx 1.15.x
    MariaDB 5.5/10.x
    Should work as i tested it myself on my test cache enabler wordpress blog on Centmin Mod server. Only diff is if you do not have HTTPS SSL certificate then replacement url for domain.com/avatar/ should be using non-HTTPS http:// and not https://
     
..