diff options
author | Reyk Floeter <reyk@cvs.openbsd.org> | 2014-07-25 17:49:12 +0000 |
---|---|---|
committer | Reyk Floeter <reyk@cvs.openbsd.org> | 2014-07-25 17:49:12 +0000 |
commit | c45ca470ec4f2b83d8d66f806844bb812d551d9d (patch) | |
tree | bde69ed7353caa708b714ab31d9e024e66aa8a47 | |
parent | 3f41d6a5d0cf3c4cd854ca029a5f9d004393f5d5 (diff) |
Add multiple-servers "virtual hosts" example.
-rw-r--r-- | usr.sbin/httpd/httpd.conf.5 | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/usr.sbin/httpd/httpd.conf.5 b/usr.sbin/httpd/httpd.conf.5 index cbd10048f29..2cb442f2c86 100644 --- a/usr.sbin/httpd/httpd.conf.5 +++ b/usr.sbin/httpd/httpd.conf.5 @@ -1,4 +1,4 @@ -.\" $OpenBSD: httpd.conf.5,v 1.6 2014/07/25 15:47:11 reyk Exp $ +.\" $OpenBSD: httpd.conf.5,v 1.7 2014/07/25 17:49:11 reyk Exp $ .\" .\" Copyright (c) 2014 Reyk Floeter <reyk@openbsd.org> .\" @@ -160,9 +160,9 @@ to the specified extension One or more names can be specified per line. .El .Sh EXAMPLES -The following example will start two pre-forked servers that are -listening on the primary IP address of the network interface that is a -member of the +The following example will start one server that is pre-forked two +times and listening on the primary IP address of the network interface +that is a member of the .Ar egress group. It additionally defines some media types overriding the defaults. @@ -185,6 +185,28 @@ types { } .Ed .Pp +Multiple servers can be configured to support hosting of different domains. +If the same address is repeated multiple times in the +.Ic listen on +statement, +the server will be matched based on the requested host name. +.Bd -literal -offset indent +server "www.a.example.com" { + listen on 203.0.113.1 port 80 + root "/htdocs/www.a.example.com" +} + +server "www.b.example.com" { + listen on 203.0.113.1 port 80 + root "/htdocs/www.b.example.com" +} + +server "intranet.example.com" { + listen on 10.0.0.1 port 80 + root "/htdocs/intranet.example.com" +} +.Ed +.Pp The syntax of the types section is compatible with the format used by .Xr nginx 8 , so it is possible to include its |