Hi, this diff applies on top of the previous one.
Rename "root strip" to "request strip" The root strip option name was semantically incorrect as it does not strip the root but the request path. This is a grammar change and it also needs a heads up and a change in other documentation (such as acme-client(1)). OK? Reyk diff --git usr.sbin/httpd/httpd.conf.5 usr.sbin/httpd/httpd.conf.5 index 9c7efbc..2a71c8d 100644 --- usr.sbin/httpd/httpd.conf.5 +++ usr.sbin/httpd/httpd.conf.5 @@ -458,12 +458,18 @@ instead of the log files. Disable any previous .Ic block in a location. -.It Ic root Ar option -Configure the document root and options for the request path. +.It Ic request Ar option +Configure the options for the request path. Valid options are: .Bl -tag -width Ds -.It Ar directory -Set the document root of the server. +.It Ic strip Ar number +Strip +.Ar number +path components from the beginning of the request path before looking +up the stripped-down path at the document root. +.El +.It Ic root Ar directory +Configure the document root of the server. The .Ar directory is a pathname within the diff --git usr.sbin/httpd/parse.y usr.sbin/httpd/parse.y index 2cdfab5..5766e96 100644 --- usr.sbin/httpd/parse.y +++ usr.sbin/httpd/parse.y @@ -486,6 +486,7 @@ serveroptsl : LISTEN ON STRING opttls port { YYERROR; } } + | request | root | directory | logformat @@ -804,7 +805,17 @@ rootflags : STRING { free($1); srv->srv_conf.flags |= SRVFLAG_ROOT; } - | STRIP NUMBER { + ; + +request : REQUEST requestflags + | REQUEST '{' optnl requestflags_l '}' + ; + +requestflags_l : requestflags optcommanl requestflags_l + | requestflags optnl + ; + +requestflags : STRIP NUMBER { if ($2 < 0 || $2 > INT_MAX) { yyerror("invalid strip number"); YYERROR;