Fixes for the server reachability test.

- Do not apply HTTPs redirection for challenge used by the test.
- Set the `User-Agent` to avoid 403 answer from site24x7.com.
- Handle JSON parsing failure of the received body.
- Better handling of different error cases.
This commit is contained in:
Jocelyn Le Sage
2023-12-13 20:32:50 -05:00
parent e08a4d4490
commit 388fff84f2
2 changed files with 25 additions and 4 deletions

View File

@ -1,3 +1,10 @@
set $test "";
if ($scheme = "http") {
set $test "H";
}
if ($request_uri = /.well-known/acme-challenge/test-challenge) {
set $test "${test}T";
}
if ($test = H) {
return 301 https://$host$request_uri;
}