Welcome to Centmin Mod Community
Register Now

Wordpress Wordpress Site Health Issue

Discussion in 'Blogs & CMS usage' started by Jon Snow, Oct 8, 2020.

  1. Jon Snow

    Jon Snow Active Member

    564
    72
    28
    Jun 30, 2017
    Ratings:
    +121
    Local Time:
    8:37 AM
    Nginx 1.13.9
    MariaDB 10.1.31
    Wordpress is reporting an issue on my self-installed blog via its new site health page:

    Error: cURL error 56: TCP connection reset by peer (http_request_failed)

    Anyone knows how I can fix this so it stops showing these as critical performance issues?
     
  2. eva2000

    eva2000 Administrator Staff Member

    45,441
    10,312
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,994
    Local Time:
    9:37 PM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    How was Wordpress installed ?
    1. Via centmin.sh menu option 22? If so which cache method did you select?
    2. If not, did you manually install Wordpress ? If so, you'd need to double check your Nginx rules are correct in your nginx vhost (see below).
    If you installed via centmin.sh menu option 22, wp-cli command line tool would have been installed so post output for

    listing your Wordpress plugins
    Code (Text):
    domain=yourdomain.com
    wp plugin list --allow-root --path=/home/nginx/domains/$domain/public
    

    and
    Code (Text):
    domain=yourdomain.com
    wp core version --extra --allow-root --path=/home/nginx/domains/$domain/public | column -t;
    


    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
     
  3. Jon Snow

    Jon Snow Active Member

    564
    72
    28
    Jun 30, 2017
    Ratings:
    +121
    Local Time:
    8:37 AM
    Nginx 1.13.9
    MariaDB 10.1.31
    I installed Wordpress myself the normal way.

    Code (Text):
    server {
      server_name domain.com www.domain.com;
      return 302 https://$server_name$request_uri;
    }
    
    server {
      listen 443 ssl http2;
      server_name domain.com www.domain.com;
    
          if ($host = 'www.domain.com' ) {
             return 302 https://domain.com$request_uri;
             }
    
    
      include /usr/local/nginx/conf/ssl/domain.com/domain.com.crt.key.conf;
      include /usr/local/nginx/conf/ssl_include.conf;
    
      http2_max_field_size 16k;
      http2_max_header_size 32k;
      # mozilla recommended
      ssl_ciphers 'ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS';
      ssl_prefer_server_ciphers   on;
      ####add_header Alternate-Protocol  443:npn-spdy/3;
    
      # before enabling HSTS line below read centminmod.com/nginx_domain_dns_setup.html#hsts
      #add_header Strict-Transport-Security "max-age=31536000; includeSubdomains;";
      #add_header X-Frame-Options SAMEORIGIN;
      #add_header X-Xss-Protection "1; mode=block" always;
      #add_header X-Content-Type-Options "nosniff" always;
      ####spdy_headers_comp 5;
      ssl_buffer_size 1369;
      ssl_session_tickets on;
     
      # enable ocsp stapling
      resolver 8.8.8.8 8.8.4.4 valid=10m;
      resolver_timeout 10s;
      ssl_stapling on;
      ssl_stapling_verify on; 
    
    # 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;
    
      # 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;
    
      location / {
      try_files $uri $uri/ /index.php?q=$request_uri;
      rewrite ^/(threads|forums|members|blog)/(.*)$ /forum/$1/$2 redirect;
    
      include /usr/local/nginx/conf/wpsecure.conf;
      include /usr/local/nginx/conf/wpnocache.conf;
      include /usr/local/nginx/conf/blockbots.conf;
      include /usr/local/nginx/conf/503include-only.conf;
    
    # block common exploits, sql injections etc
    #include /usr/local/nginx/conf/block.conf;
    
      # Enables directory listings when index file not found
      #autoindex  on;
    
      # Shows file listing times as local time
      #autoindex_localtime on;
    
      # Enable for vBulletin usage WITHOUT vbSEO installed
      # More example Nginx vhost configurations at
      # http://centminmod.com/nginx_configure.html
      #try_files    $uri $uri/ /index.php;
    
      }
    
    location /forum/ {
        try_files $uri $uri/ /forum/index.php?$uri&$args;
        index index.php index.html;
    
        include /usr/local/nginx/conf/blockbots.conf;
    }
    
    
    location /forum/install/ {
        auth_basic "Private";
        include /usr/local/nginx/conf/php.conf;
        allow 127.0.0.1;
        allow 170.82.211.3;
        deny all;
            } 
    
    location /forum/install/data/ {
        internal;
        allow 127.0.0.1;
        allow 170.82.211.3;
        deny all;
    }
    location /forum/install/templates/ {
        internal;
        allow 127.0.0.1;
        allow 170.82.211.3;
        deny all;
    }
    location /forum/internal_data/ {
        internal;
        allow 127.0.0.1;
        deny all;
    }
    location /forum/library/ {
        internal;
        allow 127.0.0.1;
        deny all;
    }
    
    
      include /usr/local/nginx/conf/staticfiles.conf;
      include /usr/local/nginx/conf/php.conf;
      #include /usr/local/nginx/conf/drop.conf;
      #include /usr/local/nginx/conf/errorpage.conf;
      include /usr/local/nginx/conf/vts_server.conf;
    }
    


    Code (Text):
    HTTP/1.1 200 OK
    Content-Type: text/html; charset=UTF-8
    Connection: keep-alive
    Vary: Accept-Encoding
    Set-Cookie: cookielawinfo-checkbox-necessary=yes; expires=Thu, 08-Oct-2020 03:26:07 GMT; Max-Age=3600; path=/
    Link: <https://domain.com/wp-json/>; rel="https://api.w.org/"
    Date: Thu, 08 Oct 2020 02:26:07 GMT
    X-Page-Speed: 1.13.35.2-0
    Cache-Control: max-age=0, no-cache
    
    
    HTTP/1.1 302 Moved Temporarily
    Date: Thu, 08 Oct 2020 02:27:07 GMT
    Content-Type: text/html
    Content-Length: 138
    Connection: keep-alive
    
    
    HTTP/1.1 302 Moved Temporarily
    Date: Thu, 08 Oct 2020 02:27:30 GMT
    Content-Type: text/html
    Content-Length: 138
    Connection: keep-alive
    
    
    HTTP/1.1 302 Moved Temporarily
    Date: Thu, 08 Oct 2020 02:27:49 GMT
    Content-Type: text/html
    Content-Length: 138
    Connection: keep-alive
     
  4. Jon Snow

    Jon Snow Active Member

    564
    72
    28
    Jun 30, 2017
    Ratings:
    +121
    Local Time:
    8:37 AM
    Nginx 1.13.9
    MariaDB 10.1.31
    @eva2000 Does everything look OK in the above?
     
  5. eva2000

    eva2000 Administrator Staff Member

    45,441
    10,312
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,994
    Local Time:
    9:37 PM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    instead ofthat try_files, try
    Code (Text):
      try_files $uri $uri/ /index.php?q=$uri&$args;
    

    and restart nginx and php-fpm
    Code (Text):
    nprestart
     
  6. eva2000

    eva2000 Administrator Staff Member

    45,441
    10,312
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,994
    Local Time:
    9:37 PM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    as you don't have WP-CLI installed to run those commands, install WP-CLI manually via running addons/wpcli.sh install addon via SSH command
    Code (Text):
    /usr/local/src/centminmod/addons/wpcli.sh install
    
     
  7. Jon Snow

    Jon Snow Active Member

    564
    72
    28
    Jun 30, 2017
    Ratings:
    +121
    Local Time:
    8:37 AM
    Nginx 1.13.9
    MariaDB 10.1.31
    Changing try_files didn't do anything unless I need to wait a while to see if there's any change.
    What's the difference between using this and checking manually?

    Code (Text):
    +-------------------+--------+--------+---------+
    | name              | status | update | version |
    +-------------------+--------+--------+---------+
    | aryo-activity-log | active | none   | 2.5.2   |
    | cookie-law-info   | active | none   | 1.9.1   |
    | wp-external-links | active | none   | 2.47    |
    | wp-user-avatar    | active | none   | 2.2.7   |
    | wordpress-seo     | active | none   | 15.0    |
    +-------------------+--------+--------+---------+


    and

    Code (Text):
    WordPress  version:   5.5.1
    Database   revision:  48748
    TinyMCE    version:   4.9100  (49100-20200624)
    Package    language:  en_US
     
  8. eva2000

    eva2000 Administrator Staff Member

    45,441
    10,312
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,994
    Local Time:
    9:37 PM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    it's for me/3rd party to see what plugins and versions you have i.e. if you have firewall or plugins which disable Wordpress API or conflict with Health checks

    should have immediate effect. Do you have your server IP and domain listed in your /etc/hosts file to bypass ISP/server DNS server ?

    I notice you have ngx_pagespeed enabled, if you disable it temporarily does it fix the issue ? As per Nginx PageSpeed - CentminMod.com LEMP Nginx web stack for CentOS
    to temp disable ngx_pagespeed, in SSH type
    Code (Text):
    pscontrol off
    

    to re-enable
    Code (Text):
    pscontrol on
    
     
  9. Jon Snow

    Jon Snow Active Member

    564
    72
    28
    Jun 30, 2017
    Ratings:
    +121
    Local Time:
    8:37 AM
    Nginx 1.13.9
    MariaDB 10.1.31
    On my Windows host file? Nope.
    I disabled it with that method and went to my wp control panel and it still stated the issues.

    Do you think it's because I have another site using Cloudflare on the same server? That site uses Wordpress too with a different IP, which I've installed the same way. That site's health status is fine while the non-Cloudflare site is affected.
     
  10. eva2000

    eva2000 Administrator Staff Member

    45,441
    10,312
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,994
    Local Time:
    9:37 PM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    It shouldn't matter I don't think
     
  11. Jon Snow

    Jon Snow Active Member

    564
    72
    28
    Jun 30, 2017
    Ratings:
    +121
    Local Time:
    8:37 AM
    Nginx 1.13.9
    MariaDB 10.1.31
    I'm not sure what it could be then :(

    Any ideas from your side?
     
  12. eva2000

    eva2000 Administrator Staff Member

    45,441
    10,312
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,994
    Local Time:
    9:37 PM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    Hard to know from my end without looking into your server.

    You might want to comment out all references to
    Code (Text):
    include /usr/local/nginx/conf/blockbots.conf;
    

    and restart nginx as it could block stuff that you don't want blocked

    What version of PHP you using ? How long as it been since you have done a yum update + cmupdate + php-fpm upgrade ? Certain yum updates require server reboot for changes to take effect i.e. kernel updates. I'd do yum update, cmupdate and php-fpm centmin.sh menu option 5 recompile/update to latest branch PHP version of 7.2.34 or 7.3.23 or 7.4.11 PHP 7.4.11, 7.3.23, 7.2.34 Security Updates + Backported PHP 7.1.33, 7.0.33 & 5.6.40 and then do a server reboot to ensure curl is working with latest updates.
     
  13. eva2000

    eva2000 Administrator Staff Member

    45,441
    10,312
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,994
    Local Time:
    9:37 PM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    One thing is have you properly configured ngx_pagespeed for HTTPS as outlined in first post at PageSpeed - This forum's pagespeed.conf ?

    the SSLCertDirectory and SslCertFile should already be in /usr/local/nginx/conf/pagespeed.conf
     
  14. Jon Snow

    Jon Snow Active Member

    564
    72
    28
    Jun 30, 2017
    Ratings:
    +121
    Local Time:
    8:37 AM
    Nginx 1.13.9
    MariaDB 10.1.31
    This was the issue.
     
  15. eva2000

    eva2000 Administrator Staff Member

    45,441
    10,312
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,994
    Local Time:
    9:37 PM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    Glad to hear it's resolved :)