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.
Subject Author Posted

How to serve subdomain from subfolder of the domain root?

etrader September 14, 2013 01:42AM

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

Francis Daly September 14, 2013 05:00AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 153
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready