Activity Stream
48,167 MEMBERS
64000 ONLINE
besthostingforums On YouTube Subscribe to our Newsletter besthostingforums On Twitter besthostingforums On Facebook besthostingforums On facebook groups

Results 1 to 6 of 6

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1.     
    #1
    Banned
    Website's:
    xsl.tel xsltel.com
    offtopic : change your avatar its sucks.

    ontopic :
    Code: 
    #Main Domain
    server {
    listen 0.0.0.0:80;
    server_name domain.com www.domain.com;
    location / {
    root /home/domains.com/www;
    }
    }
    
    #Sub Domain
    server {
    listen 0.0.0.0:80;
    server_name sub.domain.com www.sub.domain.com;
    location / {
    root /home/sub.domains.com/www;
    }
    }
    
    #Another Sub Domain
    server {
    listen 0.0.0.0:80;
    server_name sub2.domain.com www.sub2.domain.com;
    location / {
    root /home/sub2.domains.com/www;
    }
    }
    change 0.0.0.0 to your IP. this is just the main structure of how to create domain and subdomains.
    XSLTel Reviewed by XSLTel on . Nginx and subdomains Hi, I'd like to know which config is best to set main domain (domain.com) and various subdomain (example.domain.com, example2.domain.com etc..) Thanks Rating: 5

  2.   Sponsored Links

  3.     
    #2
    Member
    Website's:
    satiq.net
    Quote Originally Posted by XSLTel View Post
    offtopic : change your avatar its sucks.
    I like it

    Quote Originally Posted by XSLTel View Post
    ontopic :
    Code: 
    #Main Domain
    server {
    listen 0.0.0.0:80;
    server_name domain.com www.domain.com;
    location / {
    root /home/domains.com/www;
    }
    }
    
    #Sub Domain
    server {
    listen 0.0.0.0:80;
    server_name sub.domain.com www.sub.domain.com;
    location / {
    root /home/sub.domains.com/www;
    }
    }
    
    #Another Sub Domain
    server {
    listen 0.0.0.0:80;
    server_name sub2.domain.com www.sub2.domain.com;
    location / {
    root /home/sub2.domains.com/www;
    }
    }
    change 0.0.0.0 to your IP. this is just the main structure of how to create domain and subdomains.
    And if I want to put varnish on top nginx and listen to 80, may I change into nginx's config only the port, for example to 8080, and should work?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. How to make Subdomains on Namecheap?
    By my123world in forum Webmaster Discussion
    Replies: 1
    Last Post: 14th Dec 2011, 10:17 AM
  2. Different subdomains to different wordpress installs on 1 vps?
    By futureawesome in forum Server Management
    Replies: 2
    Last Post: 4th Aug 2011, 06:15 PM
  3. How to have multi subdomains for Blogspot Blogs
    By nICEsHARE in forum Webmaster Discussion
    Replies: 0
    Last Post: 13th Apr 2011, 06:53 AM
  4. Google rankings for subdomains
    By vin in forum Webmaster Discussion
    Replies: 0
    Last Post: 20th Dec 2010, 08:46 PM
  5. Individual subdomains
    By gmaister22 in forum General Discussion
    Replies: 13
    Last Post: 23rd Nov 2010, 06:40 PM

Tags for this Thread

BE SOCIAL