
Values: * `legacy` (default): generate location blocks for ACME HTP Challenge excepted when `HTTPS_METHOD=noredirect` or there is no certificate for the domain * `true`: generate location blocks for ACME HTP Challenge in all cases * `false`: do not generate location blocks for ACME HTP Challenge
30 lines
1,005 B
Python
30 lines
1,005 B
Python
import pytest
|
|
|
|
|
|
def test_redirect_acme_challenge_enabled(docker_compose, nginxproxy, acme_challenge_path):
|
|
r = nginxproxy.get(
|
|
f"http://web1.nginx-proxy.tld/{acme_challenge_path}",
|
|
allow_redirects=False
|
|
)
|
|
assert r.status_code == 200
|
|
|
|
def test_redirect_acme_challenge_disabled(docker_compose, nginxproxy, acme_challenge_path):
|
|
r = nginxproxy.get(
|
|
f"http://web2.nginx-proxy.tld/{acme_challenge_path}",
|
|
allow_redirects=False
|
|
)
|
|
assert r.status_code == 301
|
|
|
|
def test_noderirect_acme_challenge_enabled(docker_compose, nginxproxy, acme_challenge_path):
|
|
r = nginxproxy.get(
|
|
f"http://web3.nginx-proxy.tld/{acme_challenge_path}",
|
|
allow_redirects=False
|
|
)
|
|
assert r.status_code == 200
|
|
|
|
def test_noderirect_acme_challenge_disabled(docker_compose, nginxproxy, acme_challenge_path):
|
|
r = nginxproxy.get(
|
|
f"http://web4.nginx-proxy.tld/{acme_challenge_path}",
|
|
allow_redirects=False
|
|
)
|
|
assert r.status_code == 404
|