1 import ./make-test-python.nix ({ pkgs, lib, ... }: {
2 name = "nginx-redirectcode";
3 meta.maintainers = with lib.maintainers; [ misterio77 ];
6 webserver = { pkgs, lib, ... }: {
9 virtualHosts.localhost = {
10 globalRedirect = "example.com/foo";
11 # With 308 (and 307), the method and body are to be kept when following it
19 webserver.wait_for_unit("nginx")
20 webserver.wait_for_open_port(80)
22 # Check the status code
23 webserver.succeed("curl -si http://localhost | grep '^HTTP/[0-9.]\+ 308 Permanent Redirect'")