Browse Source

test: custom HTTP port

John Stucklen 4 years ago
parent
commit
6bb7c37605
2 changed files with 23 additions and 0 deletions
  1. 8 0
      test/test_http_port.py
  2. 15 0
      test/test_http_port.yml

+ 8 - 0
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

+ 15 - 0
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