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

Nginx Subdomain pointing to a folder inside the main domain?

Discussion in 'Nginx, PHP-FPM & MariaDB MySQL' started by pamamolf, Aug 17, 2017.

  1. pamamolf

    pamamolf Well-Known Member

    2,772
    245
    63
    May 31, 2014
    Ratings:
    +437
    Local Time:
    1:56 AM
    Nginx-1.13.x
    MariaDB 10.1.x
    Hello :)

    I want to ask if it is possible to have one main domain for example:

    Code:
    www.domainmain.com
    pointing to:

    Code:
    root /home/nginx/domains/domainmain.com/public;
    and then create a subdomain for example:

    Code:
    sub.domainmain.com
    and point it to a folder inside the main domain like:

    Code:
    root /home/nginx/domains/domainmain.com/public/folderforsub;
    Is that ok?

    I know that is not the best way to do that for a subdomain but i am wondering if it will work or not?

    Thank you
     
  2. RoldanLT

    RoldanLT Well-Known Member

    3,936
    961
    113
    May 25, 2014
    Phillipines
    Ratings:
    +1,312
    Local Time:
    7:56 AM
    1.11
    10.2
    It should work fine.
     
    • Like Like x 1
  3. pamamolf

    pamamolf Well-Known Member

    2,772
    245
    63
    May 31, 2014
    Ratings:
    +437
    Local Time:
    1:56 AM
    Nginx-1.13.x
    MariaDB 10.1.x
    Thanks :)

    I will wait for George to confirm also :)
     
  4. eva2000

    eva2000 Administrator Staff Member

    30,606
    6,862
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,297
    Local Time:
    9:56 AM
    Nginx 1.13.x
    MariaDB 5.5
    should work but only way is test and see !
     
  5. Matt

    Matt Moderator Staff Member

    693
    320
    63
    May 25, 2014
    Sheffield, UK
    Ratings:
    +447
    Local Time:
    11:56 PM
    1.7.1
    MariaDB 10
    Yes, it will work. I've worked on servers that had subdomains configured like this.
     
    • Agree Agree x 1
    • Informative Informative x 1