Split-server{ } subdomains.

Maxim Dounin mdounin at mdounin.ru
Wed Sep 9 02:08:40 MSD 2009


Hello!

On Tue, Sep 08, 2009 at 10:40:51PM +0100, Nuno Magalhães wrote:

> Hi,
> 
> Can i have:
> 
> server{
> listen 80;
> server_name domain.com www.domain.com;
> root /dir1;
> }
> server{
> listen 80;
> server_name sub.domain.com;
> root /dir2;
> }
> 
> Without adding an A-record for sub.domain.com's DNS?

Yes.  Server_name is just string that will be matched on 'Host' 
header got in request.  It doesn't matter if this string is valid 
domain name or not.

Maxim Dounin





More information about the nginx mailing list