Learn about Centmin Mod LEMP Stack today
Become a Member

My website showing centminmod page, even after importing the wordpress

Discussion in 'Install & Upgrades or Pre-Install Questions' started by pheonis, Apr 22, 2019.

  1. pheonis

    pheonis Member

    62
    3
    8
    Dec 21, 2018
    Ratings:
    +4
    Local Time:
    12:27 AM
    Please fill in any relevant information that applies to you:
    • CentOS Version: CentOS 7 64bit
    • Centmin Mod Version Installed:123.09beta01
    • Nginx Version Installed: i.e. 1.15.3
    • PHP Version Installed:7.2.9
    • MariaDB MySQL Version Installed:10.2.xx
    • When was last time updated Centmin Mod code base ? : i.e. run centmin.sh menu option 23 submenu option 2 or cmupdate command
    • Persistent Config: Do you have any persistent config file options set in /etc/centminmod/custom_config.inc ? You can check via this command:
      Code (Text):
      cat /etc/centminmod/custom_config.inc
      

      Post output in CODE tags.
    • Code (Text):
      No such file or directory

    Hi,
    The https version of my website is showing the website without any problem but the HTTP version of my website is showing the centminmod page. when i input my website name in the browser it shows the centminmod page and when i add https to it then it shows the website as usual.
    What can I do so that the HTTP version will redirect to the https version so the issue may be resolved?

     
  2. pheonis

    pheonis Member

    62
    3
    8
    Dec 21, 2018
    Ratings:
    +4
    Local Time:
    12:27 AM
    I have successfully redirected now I am getting an ERR_TOO_MANY_REDIRECTS error. Website is not opening
    Cloudflare is et to FULL STRICT
    Added below line to nginx.conf
    Code:
    include /usr/local/nginx/conf/cloudflare.conf;
    
    The SSL vhost file as follows
    Code:
     # Centmin Mod Getting Started Guide
    # must read http://centminmod.com/getstarted.html
    # For HTTP/2 SSL Setup
    # read http://centminmod.com/nginx_configure_https_ssl_spdy.html
    
    # redirect from www to non-www  forced SSL
    # uncomment, save file and restart Nginx to enable
    # if unsure use return 302 before using return 301
     server {
           server_name domain.com www.domain.com;
           return 302 https://domain.com$request_uri;
     }
    
    server {
      listen 443 ssl http2;
      server_name www.domain.com;
      return 301 https://domain.com$request_uri;
    
      ssl_dhparam /usr/local/nginx/conf/ssl/domaincom/dhparam.pem;
      ssl_certificate      /usr/local/nginx/conf/ssl/domaincom/ssl-unified.crt;
      ssl_certificate_key  /usr/local/nginx/conf/ssl/domaincom/domain_com.key;
     #ssl_trusted_certificate /usr/local/nginx/conf/ssl/domaincom/ssl-trusted.crt;
      include /usr/local/nginx/conf/ssl_include.conf;
    
     }
    
    server {
      listen 443 ssl http2;
      server_name www.domain.com;
    
      ssl_dhparam /usr/local/nginx/conf/ssl/domain.com/dhparam.pem;
      ssl_certificate      /usr/local/nginx/conf/ssl/domaincom/ssl-unified.crt;
      ssl_certificate_key  /usr/local/nginx/conf/ssl/domaincom/domain_com.key;
      #ssl_trusted_certificate /usr/local/nginx/conf/ssl/domaincom/ssl-trusted.crt;
      include /usr/local/nginx/conf/ssl_include.conf;
    
      # cloudflare authenticated origin pull cert community.centminmod.com/threads/13847/
      #ssl_client_certificate /usr/local/nginx/conf/ssl/cloudflare/domain.com/origin.crt;
      #ssl_verify_client on;
      http2_max_field_size 16k;
      http2_max_header_size 32k;
      # mozilla recommended
      ssl_ciphers 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;
      #add_header Referrer-Policy "strict-origin-when-cross-origin";
      #spdy_headers_comp 5;
      ssl_buffer_size 1369;
      ssl_session_tickets on;
    
      # enable ocsp stapling
      #resolver 8.8.8.8 8.8.4.4 1.1.1.1 1.0.0.1 valid=10m;
      #resolver_timeout 10s;
      #ssl_stapling on;
      #ssl_stapling_verify on;
      #ssl_trusted_certificate /usr/local/nginx/conf/ssl/domain.com/domain.com-trusted.crt;
    
    # 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 / {
      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;
    
      # Wordpress Permalinks example
      try_files $uri $uri/ /index.php?q=$uri&$args;
    
      }
    
      include /usr/local/nginx/conf/pre-staticfiles-local-domain.com.conf;
      include /usr/local/nginx/conf/pre-staticfiles-global.conf;
      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;
    }
    
    I use the non WWW version and the original domain is Website Domains Names & Hosting | Domain.com
     
    Last edited: Apr 22, 2019
  3. pheonis

    pheonis Member

    62
    3
    8
    Dec 21, 2018
    Ratings:
    +4
    Local Time:
    12:27 AM
    The problem has been resolved. I modified the vhost a bit.
     
  4. eva2000

    eva2000 Administrator Staff Member

    58,905
    12,490
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +19,122
    Local Time:
    4:57 AM
    Nginx 1.31.x
    MariaDB 10.x/11.4+/12.3+
    yeah this part needs correcting
    Code (Text):
     server {
          server_name domain.com www.domain.com;
          return 302 https://domain.com$request_uri;
     }
    
    server {
      listen 443 ssl http2;
      server_name www.domain.com;
    

    so 2nd server{} context's server_name lists the main domain you are redirecting to in above 302 return = non-www version
    Code (Text):
     server {
          server_name domain.com www.domain.com;
          return 302 https://domain.com$request_uri;
     }
    
    server {
      listen 443 ssl http2;
      server_name domain.com;