test_acme-http-challenge-location-disabled.py 1.3 KB

12345678910111213141516171819202122232425262728293031323334
  1. def test_redirect_acme_challenge_location_disabled(docker_compose, nginxproxy, acme_challenge_path):
  2. r = nginxproxy.get(
  3. f"http://web1.nginx-proxy.tld/{acme_challenge_path}",
  4. allow_redirects=False
  5. )
  6. assert r.status_code == 301
  7. def test_redirect_acme_challenge_location_enabled(docker_compose, nginxproxy, acme_challenge_path):
  8. r = nginxproxy.get(
  9. f"http://web2.nginx-proxy.tld/{acme_challenge_path}",
  10. allow_redirects=False
  11. )
  12. assert r.status_code == 200
  13. def test_noredirect_acme_challenge_location_disabled(docker_compose, nginxproxy, acme_challenge_path):
  14. r = nginxproxy.get(
  15. f"http://web3.nginx-proxy.tld/{acme_challenge_path}",
  16. allow_redirects=False
  17. )
  18. assert r.status_code == 404
  19. def test_noredirect_acme_challenge_location_enabled(docker_compose, nginxproxy, acme_challenge_path):
  20. r = nginxproxy.get(
  21. f"http://web4.nginx-proxy.tld/{acme_challenge_path}",
  22. allow_redirects=False
  23. )
  24. assert r.status_code == 200
  25. def test_unknown_domain_acme_challenge_location_disabled(docker_compose, nginxproxy, acme_challenge_path):
  26. r = nginxproxy.get(
  27. f"http://web-unknown.nginx-proxy.tld/{acme_challenge_path}",
  28. allow_redirects=False
  29. )
  30. assert r.status_code == 503