1 import ./make-test-python.nix ({ pkgs, ... }: {
2 name = "nginx-globalredirect";
5 webserver = { pkgs, lib, ... }: {
8 virtualHosts.localhost = {
9 globalRedirect = "other.example.com";
11 locations."/noredirect".return = "200 'foo'";
18 webserver.wait_for_unit("nginx")
19 webserver.wait_for_open_port(80)
21 webserver.succeed("curl --fail -si http://localhost/alf | grep '^Location:.*/alf'")
22 webserver.fail("curl --fail -si http://localhost/noredirect | grep '^Location:'")