From 71d7dd6565543879dc5ca20faf352066ebdbbbba Mon Sep 17 00:00:00 2001 From: Roy Dumblauskas Date: Sat, 23 Aug 2025 22:04:42 -0500 Subject: [PATCH] fix minio redirect --- homelab-services/minio-service/flake.nix | 12 +++++++++--- nixos/configuration.nix | 4 +++- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/homelab-services/minio-service/flake.nix b/homelab-services/minio-service/flake.nix index d56c45a..bd05d5c 100755 --- a/homelab-services/minio-service/flake.nix +++ b/homelab-services/minio-service/flake.nix @@ -79,9 +79,9 @@ User = "minio"; Group = "minio"; # This breaks the local browser access - # Environment = '' - # MINIO_BROWSER_REDIRECT_URL=https://${opts.default-nginx.hostname}/console - # ''; + Environment = '' + MINIO_BROWSER_REDIRECT_URL=https://${opts.default-nginx.hostname}/console + ''; EnvironmentFile = "${opts.credentialsFile}"; Restart = "always"; }; @@ -189,6 +189,12 @@ EOF # This does not work even with the MINIO_BROWSER_REDIRECT_URL set locations."/console" = { proxyPass = "http://localhost:${toString opts.consolePort}"; + extraConfig = '' + proxy_set_header Host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto $scheme; + ''; }; # Add directive for s3like queries, which only accept root path allegedly diff --git a/nixos/configuration.nix b/nixos/configuration.nix index 8968a90..b0c414e 100755 --- a/nixos/configuration.nix +++ b/nixos/configuration.nix @@ -51,8 +51,10 @@ security.acme = { acceptTerms = true; defaults = { - # use staging temporarily for testing + # use staging testing server = "https://acme-staging-v02.api.letsencrypt.org/directory"; + # use prod for deploy + # server = "https://acme-v02.api.letsencrypt.org/directory"; email = "roydumblauskas@gmail.com"; dnsProvider = "cloudflare"; credentialFiles = {