Files

33 lines
731 B
Plaintext
Raw Permalink Normal View History

2023-12-13 20:32:50 -05:00
set $test "";
2020-02-19 15:55:06 +11:00
if ($scheme = "http") {
2023-12-13 20:32:50 -05:00
set $test "H";
}
if ($request_uri = /.well-known/acme-challenge/test-challenge) {
set $test "${test}T";
}
# Check if the ssl staff has been handled
2026-02-01 00:16:17 +08:00
set $test_ssl_handled "";
if ($trust_forwarded_proto = "") {
set $trust_forwarded_proto "F";
}
if ($trust_forwarded_proto = "T") {
2026-02-01 00:16:17 +08:00
set $test_ssl_handled "${test_ssl_handled}T";
}
if ($http_x_forwarded_proto = "https") {
2026-02-01 00:16:17 +08:00
set $test_ssl_handled "${test_ssl_handled}S";
}
if ($http_x_forwarded_scheme = "https") {
2026-02-01 00:16:17 +08:00
set $test_ssl_handled "${test_ssl_handled}S";
}
2026-02-01 00:16:17 +08:00
if ($test_ssl_handled = "TSS") {
set $test_ssl_handled "TS";
}
2026-02-01 00:16:17 +08:00
if ($test_ssl_handled = "TS") {
set $test "${test}S";
}
2023-12-13 20:32:50 -05:00
if ($test = H) {
2020-02-19 15:55:06 +11:00
return 301 https://$host$request_uri;
}