From 461ae7b2ed14e4c38ecf78d791138922a6c050f3 Mon Sep 17 00:00:00 2001 From: Reyk Floeter Date: Sat, 3 Jan 2015 16:54:52 +0100 Subject: sync with -current --- TODO.md | 16 +++++++++++++++- config.c | 2 +- httpd.conf.5 | 4 ++-- parse.y | 2 +- 4 files changed, 19 insertions(+), 5 deletions(-) diff --git a/TODO.md b/TODO.md index 59f3e4f..6987b14 100644 --- a/TODO.md +++ b/TODO.md @@ -30,9 +30,23 @@ is to set a non-accessible root: root "/forbidden" } -#20150102-04 server aliases **PENDING** +#20150102-04 server aliases **CLOSED** --------------------------------------- +Update: server aliases and multiple listen statements are supported: + +> Support alias names and multiple listen statements per server block. +The implementation is done in the parser by expanding each +alias/listen into an independent server configuration; this makes it +easier to handle internally without adding additional loops or +conditions. + + server "www.example.com" { + alias "example.com" + listen on * port 80 + listen on * tls port 443 + } + Server aliases and a few restrictions of the grammar: Individual server blocks can currently only have one name and listen statement. This will be fixed in the parser later. To avoid too much repeating diff --git a/config.c b/config.c index 4969350..14fe63e 100644 --- a/config.c +++ b/config.c @@ -1,4 +1,4 @@ -/* $OpenBSD: config.c,v 1.26 2014/12/21 00:54:49 guenther Exp $ */ +/* $OpenBSD: config.c,v 1.27 2015/01/03 15:49:18 reyk Exp $ */ /* * Copyright (c) 2011 - 2014 Reyk Floeter diff --git a/httpd.conf.5 b/httpd.conf.5 index 275f48b..ff0152a 100644 --- a/httpd.conf.5 +++ b/httpd.conf.5 @@ -1,4 +1,4 @@ -.\" $OpenBSD: httpd.conf.5,v 1.40 2014/12/28 13:53:23 reyk Exp $ +.\" $OpenBSD: httpd.conf.5,v 1.41 2015/01/03 15:49:18 reyk Exp $ .\" .\" Copyright (c) 2014 Reyk Floeter .\" @@ -14,7 +14,7 @@ .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. .\" -.Dd $Mdocdate: December 28 2014 $ +.Dd $Mdocdate: January 3 2015 $ .Dt HTTPD.CONF 5 .Os .Sh NAME diff --git a/parse.y b/parse.y index 089c35c..145d99c 100644 --- a/parse.y +++ b/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.46 2014/12/21 00:54:49 guenther Exp $ */ +/* $OpenBSD: parse.y,v 1.47 2015/01/03 15:49:18 reyk Exp $ */ /* * Copyright (c) 2007 - 2014 Reyk Floeter -- cgit v1.2.3-54-g00ecf