Want more timely Centmin Mod News Updates?
Become a Member

Nginx How to change default site to load?

Discussion in 'Nginx, PHP-FPM & MariaDB MySQL' started by runos, Mar 1, 2020.

  1. runos

    runos Member

    46
    16
    8
    Dec 17, 2019
    Ratings:
    +19
    Local Time:
    8:58 AM
    1.17.6
    10
    Hi! I noticed that if I just change the DNS to my server without setting up a site, it points to a default domain. How do I change this default domain?

    Thanks!

     
  2. eva2000

    eva2000 Administrator Staff Member

    49,280
    11,294
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +17,572
    Local Time:
    10:58 AM
    Nginx 1.21.x
    MariaDB 10.x
    Default index.html is for main hostname you setup in Getting Started Guide step 1. The index.html is in it's own vhost directory in it's public web root at /usr/local/nginx/html as outlined at Centmin Mod Configuration Files - CentminMod.com LEMP Nginx web stack for CentOS

     
  3. Rake-GH

    Rake-GH Active Member

    178
    91
    28
    Jul 29, 2019
    USA
    Ratings:
    +140
    Local Time:
    8:58 PM
    default
    default
    use centmin option 2 to setup a vhost for your real site and that will be served instead of the default vhost, once it completes
     
  4. eva2000

    eva2000 Administrator Staff Member

    49,280
    11,294
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +17,572
    Local Time:
    10:58 AM
    Nginx 1.21.x
    MariaDB 10.x
    oh yes that is right too

    @runos to setup your site properly see Getting Started Guide at Getting Started Guide - CentminMod.com LEMP Nginx web stack for CentOS particularly for new site setup step 2 of the guide as you generally do not need to change main vhost name default Centmin Mod index.html page.
     
  5. runos

    runos Member

    46
    16
    8
    Dec 17, 2019
    Ratings:
    +19
    Local Time:
    8:58 AM
    1.17.6
    10
    Currently I'm not seeing any centmin "default page".
    Whenever I add a new domain to cloudflare and point it to my server, this new domain will point to one of my existing domain page (demo.com) by default before I configure the site using either centmin option 2 or 22.

    Is this a cloudflare only issue or something?
    I also deleted the default demo vhost created with the default centmin installation.

    I don't mind if it's a brand new site but for existing site with traffic, the process of migrating takes a few minutes. So I don't want my client or their visitors to freak out seeing another site loaded.
     
  6. eva2000

    eva2000 Administrator Staff Member

    49,280
    11,294
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +17,572
    Local Time:
    10:58 AM
    Nginx 1.21.x
    MariaDB 10.x
    That is normal as whenever nginx doesn't have a registered created nginx vhost for a domain, it will redirect to the default Centmin Mod index if no other site exists

    You can setup Cloudflare added site with DNS pointed to old server IP until you setup new server and then change DNS to new Centmin Mod server IP.

    Usually then you'd either create the site on it's own dedicated IP or separate VPS server if you have clients. Usually shouldn't be a problem as Centmin Mod wasn't designed for shared hosting but for a person's own sites see FAQ item 2 at FAQ - CentminMod.com LEMP Nginx web stack for CentOS