It seems nginx does silently not use basicAuth when using return:
{ pkgs, ... }: {
services.nginx.enable = true;
services.nginx.virtualHosts.localhost =
let
version1 = {
root = pkgs.writeTextDir "index.html" "hello";
locations."/" = {
tryFiles = "/index.html =404";
};
};
version2 = {
locations."/" = {
return = ''200 "hello"'';
extraConfig = ''default_type text/html;'';
};
};
in
# version1 uses basicAuth, version2 does not, somehow:
version1 // {
basicAuth.user = "password";
};
}
Does somebody know if there is something wrongly defined when using version2?