user and group dynamic content generators should be run as, the filesystem
path to the static content root, and the e-mail address to which error pages
should direct visitors.}}
+
+context Location;
+
+extern type location;
+{{A valid URI prefix}}
+
+extern val location : location -> ^Vhost & Location => [Vhost & !Location];
+extern val directory : your_path -> ^Vhost & Location => [Vhost & !Location];
+{{Set some configuration specific to a URI prefix or filesystem directory,
+ respectively.}}
extern val cond_nocase : mod_rewrite_cond_flag;
extern val ornext : mod_rewrite_cond_flag;
-extern val rewriteRule : no_spaces -> no_spaces -> [mod_rewrite_flag] -> [Vhost];
+extern val rewriteRule : no_spaces -> no_spaces -> [mod_rewrite_flag] -> [^Vhost];
{{See <a href="http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html#rewriterule">Apache
documentation for <tt>RewriteRule</tt></a>.}}
-extern val rewriteCond: no_spaces -> no_spaces -> [mod_rewrite_cond_flag] -> [Vhost];
+extern val rewriteCond: no_spaces -> no_spaces -> [mod_rewrite_cond_flag] -> [^Vhost];
{{See <a href="http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html#rewritecond">Apache
documentation for <tt>RewriteCond</tt></a>.}}
extern type proxy_port;
{{A port number above 1024}}
-extern val localProxyRewrite : no_spaces -> no_spaces -> proxy_port -> [Vhost];
+extern val localProxyRewrite : no_spaces -> no_spaces -> proxy_port -> [^Vhost];
{{All requests matching the regular expression in the first argument are
redirected to another HTTPD running on localhost at the given port, generating
the new URI by substituting variables in the second argument as per Apache
Env.string
(CharVector.all Char.isAlphaNum)
+fun validLocation s =
+ size s > 0 andalso size s < 1000 andalso CharVector.all
+ (fn ch => Char.isAlphaNum ch
+ orelse ch = #"-"
+ orelse ch = #"_"
+ orelse ch = #"."
+ orelse ch = #"/") s
+
+val _ = Env.type_one "location"
+ Env.string
+ validLocation
+
val dl = ErrorMsg.dummyLoc
val _ = Main.registerDefault ("WebNodes",
fn () => (write "</VirtualHost>\n";
app TextIO.closeOut (!vhostFiles)))
+val () = Env.container_one "location"
+ ("prefix", Env.string)
+ (fn prefix =>
+ (write "\t<Location ";
+ write prefix;
+ write ">\n"),
+ fn () => write "\t</Location>\n")
+
+val () = Env.container_one "directory"
+ ("directory", Env.string)
+ (fn directory =>
+ (write "\t<Directory ";
+ write directory;
+ write ">\n"),
+ fn () => write "\t</Directory>\n")
+
fun checkRewrite () =
if !rewriteEnabled then
()
| (_, CPrefix p2) => predImplies (p1All, p2)
| (CNot p1, CNot p2) => predImplies (p2, p1)
+ | (CRoot, CNot (CConst _, _)) => true
+ | (CConst s1, CNot (CConst s2, _)) => s1 <> s2
| _ => false
localProxyRewrite "^/(.*)$" "$1" 6666;
rewriteCond "hi" "there" [ornext];
rewriteRule "^/foo.html" "/bar.html" [redirectWith redir300, nosubreq];
+
+ location "/theMorgue" with
+ rewriteRule "A" "B" [];
+ end
end;
vhost "proxy" with
proxyPass "/proxyLand" "http://localhost:1234/otherProxyLand";
proxyPassReverse "/proxyLand" "http://localhost:1234/otherProxyLand";
+
+ directory "/home/adamc/thisPlace" with
+ rewriteRule "A" "B" [];
+ end
end;
vhost "lists" with