Welcome! Log In Create A New Profile

Advanced

How to serve subdomain from subfolder of the domain root?

September 14, 2013 01:42AM
In a server as

server {
server_name domain.com *.domain.com
root /var/www/$server_name;
}

is it possible to set locations for subdomains based on subfolders of the $server_name ?

location matching sub1.domain.com {
serving from /var/www/$server_name/sub1
}


Currently, I am using a server for each subdomain, but when the number of subdomains increases, maintaining numerous servers becomes messy.
SubjectAuthorPosted

How to serve subdomain from subfolder of the domain root?

etraderSeptember 14, 2013 01:42AM

Re: How to serve subdomain from subfolder of the domain root?

Francis DalySeptember 14, 2013 05:00AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 66
Record Number of Users: 7 on March 06, 2014
Record Number of Guests: 229 on August 01, 2014
Powered by nginx    Powered by FreeBSD    PHP Powered    Powered by Percona     ipv6 ready