summaryrefslogtreecommitdiff
path: root/systems/atlas/nginx.nix
diff options
context:
space:
mode:
Diffstat (limited to 'systems/atlas/nginx.nix')
-rw-r--r--systems/atlas/nginx.nix24
1 files changed, 18 insertions, 6 deletions
diff --git a/systems/atlas/nginx.nix b/systems/atlas/nginx.nix
index 866b605..fbf081a 100644
--- a/systems/atlas/nginx.nix
+++ b/systems/atlas/nginx.nix
@@ -1,29 +1,41 @@
-{config, ...}: let
- inherit (config.networking) domain;
-
+{
+ config,
+ lib,
+ ...
+}: let
mkProxy = endpoint: port: {
"${endpoint}" = {
proxyPass = "http://localhost:${toString port}";
proxyWebsockets = true;
};
};
+
+ toVHosts = lib.mapAttrs' (
+ name: value: lib.nameValuePair "${name}.${config.networking.domain}" value
+ );
in {
server.services.cloudflared.enable = true;
services.nginx = {
enable = true;
+ clientMaxBodySize = "1250m";
+
recommendedGzipSettings = true;
recommendedOptimisation = true;
recommendedProxySettings = true;
recommendedTlsSettings = true;
- virtualHosts = {
- "miniflux.${domain}" = {
+ virtualHosts = toVHosts {
+ cache = {
+ locations = mkProxy "/" "5000";
+ };
+
+ miniflux = {
locations = mkProxy "/" "7000";
};
- "msix.${domain}" = {
+ msix = {
root = "/var/www/msix";
};
};