From 6bb7c376059e5bbd63d8c111316dbac44cf1a2e7 Mon Sep 17 00:00:00 2001 From: John Stucklen Date: Tue, 15 Jun 2021 00:13:06 +0200 Subject: [PATCH] test: custom HTTP port --- test/test_http_port.py | 8 ++++++++ test/test_http_port.yml | 15 +++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 test/test_http_port.py create mode 100644 test/test_http_port.yml diff --git a/test/test_http_port.py b/test/test_http_port.py new file mode 100644 index 0000000..26302c5 --- /dev/null +++ b/test/test_http_port.py @@ -0,0 +1,8 @@ +import pytest + + +@pytest.mark.parametrize("subdomain", ["foo", "bar"]) +def test_web1_http_custom_port(docker_compose, nginxproxy, subdomain): + r = nginxproxy.get("http://%s.nginx-proxy.tld:8080/port" % subdomain, allow_redirects=False) + assert r.status_code == 200 + assert "answer from port 81\n" in r.text \ No newline at end of file diff --git a/test/test_http_port.yml b/test/test_http_port.yml new file mode 100644 index 0000000..a7fa0eb --- /dev/null +++ b/test/test_http_port.yml @@ -0,0 +1,15 @@ +web1: + image: web + expose: + - "81" + environment: + WEB_PORTS: "81" + VIRTUAL_HOST: "*.nginx-proxy.tld" + +sut: + image: nginxproxy/nginx-proxy:test + volumes: + - /var/run/docker.sock:/tmp/docker.sock:ro + - ./lib/ssl/dhparam.pem:/etc/nginx/dhparam/dhparam.pem:ro + environment: + HTTP_PORT: 8080 \ No newline at end of file