summaryrefslogtreecommitdiff
path: root/hosts/atlas/nginx.nix
diff options
context:
space:
mode:
authorseth <[email protected]>2023-05-21 21:20:28 -0400
committerseth <[email protected]>2023-05-21 21:20:28 -0400
commit3a7cc8116cce947f5652e0e46f4d60d59bfb5717 (patch)
tree9450413a40fd28b685deb5e26e229aeb4102eaa5 /hosts/atlas/nginx.nix
parent50da869402b650aaa39b7cbaf38a7639b2bb2d9c (diff)
atlas: start hosting miniflux
Diffstat (limited to 'hosts/atlas/nginx.nix')
-rw-r--r--hosts/atlas/nginx.nix32
1 files changed, 32 insertions, 0 deletions
diff --git a/hosts/atlas/nginx.nix b/hosts/atlas/nginx.nix
new file mode 100644
index 0000000..1fcfd45
--- /dev/null
+++ b/hosts/atlas/nginx.nix
@@ -0,0 +1,32 @@
+{config, ...}: {
+ networking.firewall.allowedTCPPorts = [80 443];
+
+ security.acme = {
+ acceptTerms = true;
+ defaults.email = "[email protected]";
+ };
+
+ services.nginx = {
+ enable = true;
+
+ recommendedGzipSettings = true;
+ recommendedOptimisation = true;
+ recommendedProxySettings = true;
+ recommendedTlsSettings = true;
+
+ virtualHosts = let
+ mkProxy = endpoint: port: {
+ "${endpoint}" = {
+ proxyPass = "http://127.0.0.1:${port}";
+ proxyWebsockets = true;
+ };
+ };
+ inherit (config.networking) domain;
+ in {
+ "miniflux.${domain}" = {
+ enableACME = true;
+ locations = mkProxy "/" "7000";
+ };
+ };
+ };
+}