test_acme-http-challenge-location-enabled-is-default.py 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. def test_redirect_acme_challenge_location_enabled(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 == 200
  7. def test_redirect_acme_challenge_location_disabled(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. expected_status_code=301
  12. )
  13. assert r.status_code == 301
  14. def test_noredirect_acme_challenge_location_enabled(docker_compose, nginxproxy, acme_challenge_path):
  15. r = nginxproxy.get(
  16. f"http://web3.nginx-proxy.tld/{acme_challenge_path}",
  17. allow_redirects=False
  18. )
  19. assert r.status_code == 200
  20. def test_noredirect_acme_challenge_location_disabled(docker_compose, nginxproxy, acme_challenge_path):
  21. r = nginxproxy.get(
  22. f"http://web4.nginx-proxy.tld/{acme_challenge_path}",
  23. allow_redirects=False,
  24. expected_status_code=404
  25. )
  26. assert r.status_code == 404