Welcome to Centmin Mod Community
Register Now

Nginx Root directory

Discussion in 'Nginx, PHP-FPM & MariaDB MySQL' started by tdubs, May 21, 2015.

  1. tdubs

    tdubs Member

    84
    12
    8
    Apr 10, 2015
    Ratings:
    +15
    Local Time:
    7:09 PM
    1.7.12
    10.0.17
    I have Centmin Mod on another VPS and know that the Nginx root directory is:

    /home/nginx/domains/domain.com/public

    But whenever I use that as my root directory, the Nginx default welcome page still displays. The path to the root directory in /usr/local/nginx/conf/conf.d/domain.com.conf shows:

    root /home/nginx/domains/boonradio.com/public; as per Centmin Mod "Getting Started."

    If I modify files in
    /usr/local/nginx/html then changes will be made publicly.

    I'm confused as to why the path isn't
    /home/nginx/domains/domain.com/public, and is /usr/local/nginx/html instead.

    Thanks!


     
  2. eva2000

    eva2000 Administrator Staff Member

    55,197
    12,251
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,829
    Local Time:
    7:09 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    what does your /usr/local/nginx/conf/conf.d/virtual.conf and /usr/local/nginx/conf/conf.d/domain.com.conf contents look like ?

    check the Getting Started Guide as it explains step 1 ensuring main hostname is setup properly and that it's DNS resolves and check end of page to see the relationship between main hostname vhost and domain vhosts.
     
  3. tdubs

    tdubs Member

    84
    12
    8
    Apr 10, 2015
    Ratings:
    +15
    Local Time:
    7:09 PM
    1.7.12
    10.0.17
  4. eva2000

    eva2000 Administrator Staff Member

    55,197
    12,251
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,829
    Local Time:
    7:09 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    make sure the server_name in virtual.conf resolves DNS wise to server ip address as well but that shouldn't cause your domain.com.conf to server /usr/local/nginx/html as rest of your respective nginx vhost look correct to me

    but make sure after making vhost changes you restart nginx server
     
  5. tdubs

    tdubs Member

    84
    12
    8
    Apr 10, 2015
    Ratings:
    +15
    Local Time:
    7:09 PM
    1.7.12
    10.0.17
    Still no luck. I compared config files and hosts file with my other VPS and still nothing.
     
  6. eva2000

    eva2000 Administrator Staff Member

    55,197
    12,251
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,829
    Local Time:
    7:09 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    only thing i can think of is dns related
     
  7. tdubs

    tdubs Member

    84
    12
    8
    Apr 10, 2015
    Ratings:
    +15
    Local Time:
    7:09 PM
    1.7.12
    10.0.17
    For it to be working in /usr/local/nginx/html but not /home/nginx/domains/domain.com/public?
     
  8. eva2000

    eva2000 Administrator Staff Member

    55,197
    12,251
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,829
    Local Time:
    7:09 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    if server_name boonradio.com www.boonradio.com; doesn't resolve or nginx doesn't pick it up access to those domains might serve the default server's web root /usr/local/nginx/html for virtual.conf

    make sure you didn't mess up /usr/local/nginx/conf/conf.d/boonradio.com.conf or have duplicate .conf by accident

    check what's listed on nginx vhost config directory

    Code:
    ls -lah /usr/local/nginx/conf/conf.d/
     
  9. tdubs

    tdubs Member

    84
    12
    8
    Apr 10, 2015
    Ratings:
    +15
    Local Time:
    7:09 PM
    1.7.12
    10.0.17
    Fixed it. It was to do with the DNS as I didn't have the domain's Cloudflare pointing to the new server IP address.
     
  10. eva2000

    eva2000 Administrator Staff Member

    55,197
    12,251
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,829
    Local Time:
    7:09 PM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    yup guessed something like that would be it :)