test: VIRTUAL_PORT != single exposed port
This commit is contained in:
parent
97a5dec57a
commit
3785649eb6
2 changed files with 23 additions and 0 deletions
|
@ -0,0 +1,8 @@
|
|||
import pytest
|
||||
import re
|
||||
|
||||
|
||||
def test_answer_is_served_from_virtual_port_which_is_ureachable(docker_compose, nginxproxy):
|
||||
r = nginxproxy.get("http://web.nginx-proxy.tld/port")
|
||||
assert r.status_code == 502
|
||||
assert re.search(r"\n\s+server \d+\.\d+\.\d+\.\d+:90;\n", nginxproxy.get_conf().decode('ASCII'))
|
|
@ -0,0 +1,15 @@
|
|||
web:
|
||||
image: web
|
||||
expose:
|
||||
- "81"
|
||||
environment:
|
||||
WEB_PORTS: "81"
|
||||
VIRTUAL_HOST: "web.nginx-proxy.tld"
|
||||
VIRTUAL_PORT: "90"
|
||||
|
||||
|
||||
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
|
Loading…
Reference in a new issue