1
0
mirror of https://github.com/thib8956/nginx-proxy synced 2025-06-30 22:05:46 +00:00

fix: constistent behavior for HTTPS_METHOD=nohttp

Without this fix the response of nohttp sites to HTTP requests changes
depending on the existence of at least one HTTP enabled site:
* no HTTP enabled sites -> connection refused
* at least one HTTP enabled site -> 503

This fix ensures the response is always 503.
This commit is contained in:
Gilles Filippini
2024-05-14 22:30:06 +02:00
parent 2564a93966
commit 91652aac48
3 changed files with 10 additions and 13 deletions

View File

@ -3,15 +3,15 @@ import requests
def test_web2_http_is_connection_refused(docker_compose, nginxproxy):
with pytest.raises(requests.exceptions.RequestException, match="Connection refused"):
nginxproxy.get("http://web2.nginx-proxy.tld/")
r = nginxproxy.get("http://web2.nginx-proxy.tld/", allow_redirects=False)
assert r.status_code == 503
def test_web2_http_is_connection_refused_for_acme_challenge(
docker_compose, nginxproxy, acme_challenge_path
):
with pytest.raises(requests.exceptions.RequestException, match="Connection refused"):
nginxproxy.get(f"http://web2.nginx-proxy.tld/{acme_challenge_path}")
r = nginxproxy.get(f"http://web2.nginx-proxy.tld/{acme_challenge_path}", allow_redirects=False)
assert r.status_code == 503
def test_web2_https_is_forwarded(docker_compose, nginxproxy):