Ok I’ve read every single article or blog post on this but I can’t figure out how to get it to work. I’m setting up a new website with nginx as my web server. I just have a single index.html
file in /home/nix/test/index.html
, and my configuration.nix
is:
{ modulesPath, pkgs, user, ... }:
{
imports = [
(modulesPath + "/virtualisation/digital-ocean-config.nix")
];
users.users."nix" = {
isNormalUser = true;
extraGroups = [ "wheel" ];
home = "/home/nix";
shell = pkgs.fish;
};
networking = {
hostName = "test";
firewall = {
allowedTCPPorts = [ 80 443 ];
};
};
services.nginx = {
enable = true;
statusPage = true;
recommendedOptimisation = true;
virtualHosts."test.com" = {
# addSSL = true;
# enableACME = true;
root = "/home/nix/test";
};
};
}
where I have my actual site instead of test.com
. The nginx
process is run by the nginx
user, the /home/nix/test
directory is owned by the nix
user and has 744 permissions, and /home/nix/test/index.html
file has 644 permissions and is also owned by nix
.
If I curl 0.0.0.0:80
on my remote vps I get
<html>
<head><title>403 Forbidden</title></head>
<body>
<center><h1>403 Forbidden</h1></center>
<hr><center>nginx</center>
</body>
</html>
What am I doing wrong?