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

Nginx Question about installing WordPress on CMM

Discussion in 'Install & Upgrades or Pre-Install Questions' started by Jay Chen, Dec 7, 2021.

  1. Jay Chen

    Jay Chen Active Member

    181
    60
    28
    Sep 10, 2017
    Ratings:
    +116
    Local Time:
    12:44 PM
    • CentOS Version: CentOS 7 64bit
    • Centmin Mod Version Installed: 123.09beta01
    • Nginx Version Installed: i.e. 1.15.3
    • PHP Version Installed: i.e. 5.6.37, 7.0.31, 7.1.21, 7.2.9
    • MariaDB MySQL Version Installed: i.e. 10.0.x or 10.1.xx or 10.2.xx
    • When was last time updated Centmin Mod code base ? : run centmin.sh menu option 23 submenu option 2
    • Persistent Config:
      Code (Text):
      NGINX_SSLCACHE_ALLOWOVERRIDE='y'
      SET_DEFAULT_MYSQLCHARSET='utf8mb4'
      AUTOHARDTUNE_NGINXBACKLOG='y'
      ZSTD_LOGROTATE_NGINX='y'
      ZSTD_LOGROTATE_PHPFPM='y'
      NGINX_LIBBROTLI='y'
      NGXDYNAMIC_BROTLI='y'
      PHP_PGO='y'
      PHP_BROTLI='y'
      PHP_LZFOUR='y'
      PHP_LZF='y'
      PHP_ZSTD='y'
      LETSENCRYPT_DETECT='y'
      DUALCERTS='y'
      

    Code (Text):
    Do you want to continue with Nginx vhost site creation ? [y/n] y
    
    Enter vhost domain name you want to add (without www. prefix): dev.domain.com
    
    Create a self-signed SSL certificate Nginx vhost? [y/n]: y
    Get Letsencrypt SSL certificate Nginx vhost? [y/n]: y
    
    You have 4 options:
    1. issue staging test cert with HTTP + HTTPS (untrusted)
    2. issue staging test cert with HTTPS default (untrusted)
    3. issue live cert with HTTP + HTTPS (trusted)
    4. issue live cert with HTTPS default (trusted)
    Enter option number 1-4: 4
    

    I chose issue live cert with HTTPS default, but when it is done installing wordpress, when I access dev.domain.com, it is redirecting https://dev.domain.com/, which is good.
    But if I try try the following, I always get This site can’t be reached.
    Am I doing something wrong? Its been a long since I last installed wordpress with CMM.

    Below is ssl.conf:
    Code (Text):
    #x# HTTPS-DEFAULT
     server {
       server_name dev.domain.com www.dev.domain.com;
       return 302 https://dev.domain.com$request_uri;
       root /home/nginx/domains/dev.domain.com/public;
       include /usr/local/nginx/conf/staticfiles.conf;
     }
    
    server {
      listen 443 ssl http2 reuseport;
      server_name dev.domain.com www.dev.domain.com;
    
      include /usr/local/nginx/conf/ssl/dev.domain.com/dev.domain.com.crt.key.conf;
      include /usr/local/nginx/conf/ssl_include.conf;
    


     
  2. eva2000

    eva2000 Administrator Staff Member

    54,907
    12,240
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,811
    Local Time:
    2:44 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    Do you even have a valid DNS record for www.dev.domain.com ? If you use Cloudflare, free SSL certificates also don't go 3rd level subdomains, only 2nd level for dev.domain.com or www.domain.com. If you want 3rd level subdomains with Cloudflare SSL certificates you need to upgrade and pay for Advance Certificate Management at US$10/month.

    Generally for subdomains, you can ignore www.dev.domain.com and just use dev.domain.com
     
  3. Jay Chen

    Jay Chen Active Member

    181
    60
    28
    Sep 10, 2017
    Ratings:
    +116
    Local Time:
    12:44 PM
    Got it, I thought I something wrong when installing. Thanks a lot @eva2000