Want more timely Centmin Mod News Updates?
Become a Member

Wordpress Product & Category Page 404 Errors on Dev Site (Cloned)

Discussion in 'Blogs & CMS usage' started by SineDave, Jun 2, 2021.

  1. SineDave

    SineDave New Member

    7
    0
    1
    Nov 22, 2019
    Ratings:
    +2
    Local Time:
    3:35 AM
    I just recently set up a dev vhost using the Option 22 menu.

    Strangely, the home page works, but when I browse to a page, I get a 404:

    upload_2021-6-1_14-59-29.png

    Error log:


    upload_2021-6-1_14-59-44.png

    Here's the vhost config:

    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 dev.discounthomevideo.com;
    #            return 301 $scheme://www.dev.discounthomevideo.com$request_uri;
    #       }
    
    server {
     
      server_name dev.discounthomevideo.com www.dev.discounthomevideo.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";
      #add_header Feature-Policy "accelerometer 'none'; camera 'none'; geolocation 'none'; gyroscope 'none'; magnetometer 'none'; microphone 'none'; payment 'none'; usb 'none'";
    
      # limit_conn limit_per_ip 16;
      # ssi  on;
    
      access_log /home/nginx/domains/dev.discounthomevideo.com/log/access.log combined buffer=256k flush=5m;
      error_log /home/nginx/domains/dev.discounthomevideo.com/log/error.log;
    
      include /usr/local/nginx/conf/autoprotect/dev.discounthomevideo.com/autoprotect-dev.discounthomevideo.com.conf;
      root /home/nginx/domains/dev.discounthomevideo.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/dev.discounthomevideo.com/wpcacheenabler_dev.discounthomevideo.com.conf;
      #include /usr/local/nginx/conf/wpincludes/dev.discounthomevideo.com/wpsupercache_dev.discounthomevideo.com.conf;
      # https://community.centminmod.com/posts/18828/
      #include /usr/local/nginx/conf/wpincludes/dev.discounthomevideo.com/rediscache_dev.discounthomevideo.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_webp $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/dev.discounthomevideo.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/dev.discounthomevideo.com/wpsecure_dev.discounthomevideo.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/pre-staticfiles-local-dev.discounthomevideo.com.conf;
      include /usr/local/nginx/conf/pre-staticfiles-global.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;
    }
    
     
  2. eva2000

    eva2000 Administrator Staff Member

    46,851
    10,627
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +16,493
    Local Time:
    6:35 PM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    Nginx vhost doesn't seem correct there are some variables with escaped backslash in from i.e. for try_files which is strange. Did you edit try_files yourself to disable cache enabler ? which cache method did you select when running centmin.sh menu option 22 ?
     
  3. SineDave

    SineDave New Member

    7
    0
    1
    Nov 22, 2019
    Ratings:
    +2
    Local Time:
    3:35 AM
    I just removed my vhost and recreated using option 22, and it seems to work now. Sorry for the trouble!
     
  4. eva2000

    eva2000 Administrator Staff Member

    46,851
    10,627
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +16,493
    Local Time:
    6:35 PM
    Nginx 1.19.x
    MariaDB 5.5/10.x
    Ok thanks for the update :)