From 27af159fdcb135e5876788653d2aa6bf080725de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Igor=20B=C3=B6hm?= Date: Sat, 30 Oct 2021 23:59:12 +0000 Subject: [PATCH] rc-httpd(8): document how to use HTTP basic authentication --- sys/man/8/rc-httpd | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/sys/man/8/rc-httpd b/sys/man/8/rc-httpd index 8301fc42d..fe09d8a6f 100644 --- a/sys/man/8/rc-httpd +++ b/sys/man/8/rc-httpd @@ -80,6 +80,11 @@ variable. Fine-grained control of specific request strings may be configured via a similar method acting upon the .I location and/or other variables. +.PP +The +.I REMOTE_USER +variable provides a user identification string supplied by the +client as part of user authentication. .SH EXAMPLES The following examples demonstrate possible ways to configure .BR select-handler. @@ -95,6 +100,20 @@ if(~ $SERVER_NAME 9front.org){ .EE .RE .PP +HTTP basic authentication: +.RS +.EX +if(~ $SERVER_NAME *restricted.org){ + PATH_INFO=$location + FS_ROOT=/usr/kgb/www/$SERVER_NAME + authorize + if(~ $REMOTE_USER (glenda kgb)) + exec static-or-index + error 401 +} +.EE +.RE +.PP CGI: .RS .EX @@ -152,6 +171,8 @@ exec /rc/bin/rc-httpd/rc-httpd >>[2]/sys/log/www .TP .B /rc/bin/rc-httpd/select-handler .TP +.B /rc/bin/rc-httpd/handlers/authorize +.TP .B /rc/bin/rc-httpd/handlers/cgi .TP .B /rc/bin/rc-httpd/handlers/dir-index