@@ -41,6 +41,11 @@ import ./make-test-python.nix (
4141 "http://localhost:8081" = { } ;
4242 } ;
4343 } ;
44+ specialisation . multiple-hostnames . configuration = {
45+ services . caddy . virtualHosts = {
46+ "http://localhost:8080 http://localhost:8081" = { } ;
47+ } ;
48+ } ;
4449 specialisation . rfc42 . configuration = {
4550 services . caddy . settings = {
4651 apps . http . servers . default = {
@@ -70,7 +75,7 @@ import ./make-test-python.nix (
7075 services . caddy = {
7176 package = pkgs . caddy . withPlugins {
7277 plugins = [ "github.com/caddyserver/[email protected] " ] ; 73- hash = "sha256-zgMdtOJbmtRSfTlrrg8njr11in2C7OAXLB+34V23jek =" ;
78+ hash = "sha256-BorJJWICgAWU7DrpDZJWifMnIYtGWldt/4S1VELwGJI =" ;
7479 } ;
7580 configFile = pkgs . writeText "Caddyfile" ''
7681 {
@@ -93,6 +98,7 @@ import ./make-test-python.nix (
9398 explicitConfigFile = "${ nodes . webserver . system . build . toplevel } /specialisation/explicit-config-file" ;
9499 justReloadSystem = "${ nodes . webserver . system . build . toplevel } /specialisation/config-reload" ;
95100 multipleConfigs = "${ nodes . webserver . system . build . toplevel } /specialisation/multiple-configs" ;
101+ multipleHostnames = "${ nodes . webserver . system . build . toplevel } /specialisation/multiple-hostnames" ;
96102 rfc42Config = "${ nodes . webserver . system . build . toplevel } /specialisation/rfc42" ;
97103 withPluginsConfig = "${ nodes . webserver . system . build . toplevel } /specialisation/with-plugins" ;
98104 in
@@ -117,6 +123,13 @@ import ./make-test-python.nix (
117123 webserver.wait_for_open_port(8080)
118124 webserver.wait_for_open_port(8081)
119125
126+ with subtest("a virtual host with multiple hostnames works"):
127+ webserver.succeed(
128+ "${ multipleHostnames } /bin/switch-to-configuration test >&2"
129+ )
130+ webserver.wait_for_open_port(8080)
131+ webserver.wait_for_open_port(8081)
132+
120133 with subtest("rfc42 settings config"):
121134 webserver.succeed(
122135 "${ rfc42Config } /bin/switch-to-configuration test >&2"
0 commit comments