diff --git a/profiles/servers/nginx.nix b/profiles/servers/nginx.nix new file mode 100644 index 0000000..429d36c --- /dev/null +++ b/profiles/servers/nginx.nix @@ -0,0 +1,39 @@ +{ pkgs, config, lib, ... }: { + services.nginx = { + enable = true; + recommendedTlsSettings = true; + recommendedOptimisation = true; + recommendedGzipSettings = true; + recommendedProxySettings = true; + appendHttpConfig = "charset utf-8;"; + virtualHosts = let + default = { + forceSSL = false; + enableACME = false; + }; + in { + "ataraxiadev.com" = { + default = true; + locations."/" = { + root = "/var/lib/ataraxiadev.com"; + # index = "index.txt"; + }; + locations."/.well-known" = { + proxyPass = "http://localhost:13748"; + }; + locations."/_matrix" = { + proxyPass = "http://localhost:13748"; + }; + } // default; + "matrix.ataraxiadev.com" = { + locations."/" = { + proxyPass = "http://localhost:13748"; + }; + } // default; + }; + }; + # security.acme = { + # email = "ataraxiadev@ataraxiadev.com"; + # acceptTerms = true; + # }; +} \ No newline at end of file diff --git a/roles/server.nix b/roles/server.nix index 5726c73..908a18e 100644 --- a/roles/server.nix +++ b/roles/server.nix @@ -19,5 +19,7 @@ zsh direnv + + nginx ]; }