Welcome to Centmin Mod Community
Register Now

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

    42
    13
    8
    Dec 17, 2019
    Ratings:
    +16
    Local Time:
    4:49 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

    43,526
    9,875
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,251
    Local Time:
    6:49 AM
    Nginx 1.17.x
    MariaDB 5.5/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

    101
    40
    28
    Jul 29, 2019
    USA
    Ratings:
    +67
    Local Time:
    4:49 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

    43,526
    9,875
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,251
    Local Time:
    6:49 AM
    Nginx 1.17.x
    MariaDB 5.5/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

    42
    13
    8
    Dec 17, 2019
    Ratings:
    +16
    Local Time:
    4:49 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

    43,526
    9,875
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +15,251
    Local Time:
    6:49 AM
    Nginx 1.17.x
    MariaDB 5.5/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