1 import ./make-test-python.nix ({ pkgs, ... }:
3 nginxSocketPath = "/var/run/nginx/test.sock";
6 name = "nginx-unix-socket";
9 webserver = { pkgs, lib, ... }: {
12 virtualHosts.localhost = {
13 serverName = "localhost";
14 listen = [{ addr = "unix:${nginxSocketPath}"; }];
15 locations."/test".return = "200 'foo'";
22 webserver.wait_for_unit("nginx")
23 webserver.wait_for_open_unix_socket("${nginxSocketPath}")
25 webserver.succeed("curl --fail --silent --unix-socket '${nginxSocketPath}' http://localhost/test | grep '^foo$'")