Join the community today
Register Now

Nginx Root directory

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

  1. tdubs

    tdubs Member

    77
    11
    8
    Apr 10, 2015
    Ratings:
    +14
    Local Time:
    11:15 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

    28,972
    6,576
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,760
    Local Time:
    11:15 PM
    Nginx 1.13.x
    MariaDB 5.5
    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

    77
    11
    8
    Apr 10, 2015
    Ratings:
    +14
    Local Time:
    11:15 PM
    1.7.12
    10.0.17
  4. eva2000

    eva2000 Administrator Staff Member

    28,972
    6,576
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,760
    Local Time:
    11:15 PM
    Nginx 1.13.x
    MariaDB 5.5
    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

    77
    11
    8
    Apr 10, 2015
    Ratings:
    +14
    Local Time:
    11:15 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

    28,972
    6,576
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,760
    Local Time:
    11:15 PM
    Nginx 1.13.x
    MariaDB 5.5
    only thing i can think of is dns related
     
  7. tdubs

    tdubs Member

    77
    11
    8
    Apr 10, 2015
    Ratings:
    +14
    Local Time:
    11:15 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

    28,972
    6,576
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,760
    Local Time:
    11:15 PM
    Nginx 1.13.x
    MariaDB 5.5
    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/
     
    • Like Like x 1
  9. tdubs

    tdubs Member

    77
    11
    8
    Apr 10, 2015
    Ratings:
    +14
    Local Time:
    11:15 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.
     
    • Like Like x 1
  10. eva2000

    eva2000 Administrator Staff Member

    28,972
    6,576
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,760
    Local Time:
    11:15 PM
    Nginx 1.13.x
    MariaDB 5.5
    yup guessed something like that would be it :)