Skip to content

Commit 7308f32

Browse files
authored
Builds: fix cURL command for healthcheck in production (#12358)
We require `--insecure` and `-H "Host:"` arguments to make it work.
1 parent 9fb4b22 commit 7308f32

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

readthedocs/doc_builder/environments.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -876,7 +876,10 @@ def _run_background_healthcheck(self):
876876
build_builder = self.build.get("builder")
877877
healthcheck_url = reverse("build-healthcheck", kwargs={"pk": build_id})
878878
url = f"{settings.SLUMBER_API_HOST}{healthcheck_url}?builder={build_builder}"
879-
cmd = f"/bin/bash -c 'while true; do curl --max-time 2 -X POST {url}; sleep {settings.RTD_BUILD_HEALTHCHECK_DELAY}; done;'"
879+
880+
# We use --insecure because we are hitting the internal load balancer here that doesn't have a SSL certificate
881+
# The -H "Host: " header is required because of internal load balancer URL
882+
cmd = f"/bin/bash -c 'while true; do curl --insecure --max-time 2 -H \"Host: {settings.PRODUCTION_DOMAIN}\" -X POST {url}; sleep {settings.RTD_BUILD_HEALTHCHECK_DELAY}; done;'"
880883
log.info("Healthcheck command to run.", command=cmd)
881884

882885
client = self.get_client()

0 commit comments

Comments
 (0)