From 5de8f99f03899f5791447bbcc0e1f3e87cf87868 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Forsman?= Date: Tue, 27 Feb 2018 12:55:11 +0100 Subject: [PATCH] nixos/jenkins: ensure postStart follows redirects Pass the -L flag to curl to make it follow redirects. This fixes an issue I found when setting up reverse proxy for Jenkins. Without this fix, the returned HTTP code was stuck at 302, making postStart fail the service (it expects 200 or 403). --- .../modules/services/continuous-integration/jenkins/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nixos/modules/services/continuous-integration/jenkins/default.nix b/nixos/modules/services/continuous-integration/jenkins/default.nix index 0dd59e4fb444..54047a50caa6 100644 --- a/nixos/modules/services/continuous-integration/jenkins/default.nix +++ b/nixos/modules/services/continuous-integration/jenkins/default.nix @@ -208,7 +208,7 @@ in { ''; postStart = '' - until [[ $(${pkgs.curl.bin}/bin/curl -s --head -w '\n%{http_code}' http://${cfg.listenAddress}:${toString cfg.port}${cfg.prefix} | tail -n1) =~ ^(200|403)$ ]]; do + until [[ $(${pkgs.curl.bin}/bin/curl -L -s --head -w '\n%{http_code}' http://${cfg.listenAddress}:${toString cfg.port}${cfg.prefix} | tail -n1) =~ ^(200|403)$ ]]; do sleep 1 done '';