summaryrefslogtreecommitdiff
path: root/bin/contrib/rc-httpd/handlers/static-or-cgi
diff options
context:
space:
mode:
Diffstat (limited to 'bin/contrib/rc-httpd/handlers/static-or-cgi')
-rwxr-xr-xbin/contrib/rc-httpd/handlers/static-or-cgi14
1 files changed, 14 insertions, 0 deletions
diff --git a/bin/contrib/rc-httpd/handlers/static-or-cgi b/bin/contrib/rc-httpd/handlers/static-or-cgi
new file mode 100755
index 0000000..4d8a2d4
--- /dev/null
+++ b/bin/contrib/rc-httpd/handlers/static-or-cgi
@@ -0,0 +1,14 @@
+#!/bin/rc
+cgiargs=$*
+
+fn error{
+ if(~ $1 404)
+ exec cgi $cgiargs
+ if not
+ $rc_httpd_dir/handlers/error $1
+}
+
+if(~ $location */)
+ exec cgi $cgiargs
+if not
+ exec serve-static