diff options
Diffstat (limited to 'httpd.conf.5')
-rw-r--r-- | httpd.conf.5 | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/httpd.conf.5 b/httpd.conf.5 index f40273c..6db62e8 100644 --- a/httpd.conf.5 +++ b/httpd.conf.5 @@ -150,6 +150,20 @@ and must be readable by the www user. Use the .Ic no authenticate directive to disable authentication in a location. +.It Ic block drop +Drop the connection without sending an error page. +.It Ic block Op Ic return Ar code Op uri +Close the connection and send an error page. +If the optional return code is not specified, +.Xr httpd 8 +denies access with a +.Sq 404 Forbidden +response. +The optional +.Ar uri +argument can be used with return codes in the 3xx range to send a +.Sq Location: +header for redirection to a specified URI. .It Ic connection Ar option Set the specified options and limits for HTTP connections. Valid options are: @@ -261,6 +275,10 @@ Enable or disable logging to .Xr syslog 3 instead of the log files. .El +.It Ic pass +Disable any previous +.Ic block +in a location. .It Ic root Ar option Configure the document root and options for the request path. Valid options are: @@ -440,6 +458,20 @@ server "intranet.example.com" { } .Ed .Pp +Simple redirections can be configured with the +.Ic block +directive: +.Bd -literal -offset indent +server "example.com" { + listen on 10.0.0.1 port 80 + block return 301 "http://www.example.com/" +} + +server "www.example.com" { + listen on 10.0.0.1 port 80 +} +.Ed +.Pp The syntax of the types section is also compatible with the format used by nginx, so it is possible to include its .Pa mime.types |