Activity Stream
48,167 MEMBERS
61481 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
    Member
    Website's:
    satiq.net

    Default 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
    skinner Reviewed by skinner 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
    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.

  4.     
    #3
    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?

  5.     
    #4
    Banned
    Website's:
    xsl.tel xsltel.com
    yeah just change 0.0.0.0:80 to 0.0.0.0:8080.

    also please notice you will need to bypass php files to fastcgi wrapper . else it won't able to read php files I will assume you already know that or will google it .

  6.     
    #5
    Member
    Website's:
    satiq.net
    Quote Originally Posted by XSLTel View Post
    yeah just change 0.0.0.0:80 to 0.0.0.0:8080.

    also please notice you will need to bypass php files to fastcgi wrapper . else it won't able to read php files I will assume you already know that or will google it .
    Thanks,

    yes I know about php..

    Best Regards

  7.     
    #6
    Member
    Website's:
    oneddl.eu nfomation.net linksafe.me
    ewww varnish.

    You should try nginx's inbuilt proxy cache, I hear it works very well.

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