* In a vhost, merge in the robots.txt for the main server.
svn path=/nixos/trunk/; revision=10688
This commit is contained in:
parent
44fceb9c4d
commit
b9d01830d3
@ -1166,20 +1166,6 @@
|
|||||||
";
|
";
|
||||||
};
|
};
|
||||||
|
|
||||||
hostName = mkOption {
|
|
||||||
default = "localhost";
|
|
||||||
description = "
|
|
||||||
Canonical hostname for the server.
|
|
||||||
";
|
|
||||||
};
|
|
||||||
|
|
||||||
httpPort = mkOption {
|
|
||||||
default = 80;
|
|
||||||
description = "
|
|
||||||
Port for unencrypted HTTP requests.
|
|
||||||
";
|
|
||||||
};
|
|
||||||
|
|
||||||
httpsPort = mkOption {
|
httpsPort = mkOption {
|
||||||
default = 443;
|
default = 443;
|
||||||
description = "
|
description = "
|
||||||
@ -1235,6 +1221,24 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
virtualHosts = mkOption {
|
||||||
|
default = [];
|
||||||
|
example = [
|
||||||
|
{ hostName = "foo";
|
||||||
|
documentRoot = "/data/webroot-foo";
|
||||||
|
}
|
||||||
|
{ hostName = "bar";
|
||||||
|
documentRoot = "/data/webroot-bar";
|
||||||
|
}
|
||||||
|
];
|
||||||
|
description = ''
|
||||||
|
Specification of the virtual hosts served by Apache. Each
|
||||||
|
element should be an attribute set specifying the
|
||||||
|
configuration of the virtual host. The available options
|
||||||
|
are the non-global options permissible for the main host.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
subservices = {
|
subservices = {
|
||||||
|
|
||||||
# !!! remove this
|
# !!! remove this
|
||||||
|
@ -29,7 +29,9 @@ let
|
|||||||
in map f defs;
|
in map f defs;
|
||||||
|
|
||||||
|
|
||||||
allSubservices = callSubservices (makeServerInfo cfg) cfg.extraSubservices;
|
mainSubservices = callSubservices (makeServerInfo cfg) cfg.extraSubservices;
|
||||||
|
|
||||||
|
allSubservices = mainSubservices;
|
||||||
|
|
||||||
|
|
||||||
# !!! should be in lib
|
# !!! should be in lib
|
||||||
@ -150,6 +152,9 @@ let
|
|||||||
'';
|
'';
|
||||||
|
|
||||||
robotsTxt = pkgs.writeText "robots.txt" ''
|
robotsTxt = pkgs.writeText "robots.txt" ''
|
||||||
|
${# If this is a vhost, the include the entries for the main server as well.
|
||||||
|
if isMainServer then ""
|
||||||
|
else concatMapStrings (svc: svc.robotsEntries) mainSubservices}
|
||||||
${concatMapStrings (svc: svc.robotsEntries) subservices}
|
${concatMapStrings (svc: svc.robotsEntries) subservices}
|
||||||
'';
|
'';
|
||||||
|
|
||||||
@ -276,11 +281,6 @@ let
|
|||||||
# Always enable virtual hosts; it doesn't seem to hurt.
|
# Always enable virtual hosts; it doesn't seem to hurt.
|
||||||
NameVirtualHost *:*
|
NameVirtualHost *:*
|
||||||
|
|
||||||
# Catch-all: since this is the first virtual host, any
|
|
||||||
# non-matching requests will use the main server configuration.
|
|
||||||
<VirtualHost *:*>
|
|
||||||
</VirtualHost>
|
|
||||||
|
|
||||||
${let
|
${let
|
||||||
perServerOptions = import ./per-server-options.nix {
|
perServerOptions = import ./per-server-options.nix {
|
||||||
inherit (pkgs.lib) mkOption;
|
inherit (pkgs.lib) mkOption;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user