From 3fb7c6dff7ebe99497526c1356004a33fffa3458 Mon Sep 17 00:00:00 2001 From: Gabriel Fontes Date: Sun, 16 Oct 2022 02:24:18 -0300 Subject: [PATCH] electra/hydra: add a simple redirect for hydra badges --- hosts/electra/services/hydra.nix | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/hosts/electra/services/hydra.nix b/hosts/electra/services/hydra.nix index 8fa18489..c67fe0d7 100644 --- a/hosts/electra/services/hydra.nix +++ b/hosts/electra/services/hydra.nix @@ -76,8 +76,12 @@ in "hydra.m7.rs" = { forceSSL = true; enableACME = true; - locations."/".proxyPass = - "http://localhost:${toString config.services.hydra.port}"; + locations = { + "~* ^/shield/([^\\s]*)".return = + "302 https://img.shields.io/endpoint?url=https://hydra.m7.rs/$1/shield"; + "/".proxyPass = + "http://localhost:${toString config.services.hydra.port}"; + }; }; }; };