mirror of
https://github.com/thib8956/nginx-proxy
synced 2025-07-01 14:25:46 +00:00
fix: Replace mDNS .local domain with .example domain
See RFC 6762 for details on mDNS .local domain: https://datatracker.ietf.org/doc/html/rfc6762 And RFC 6761 for details on .example domain: https://datatracker.ietf.org/doc/html/rfc6761
This commit is contained in:
@ -6,14 +6,14 @@ def test_custom_default_conf_does_not_apply_to_unknown_vhost(docker_compose, ngi
|
||||
assert "X-test" not in r.headers
|
||||
|
||||
def test_custom_default_conf_applies_to_web1(docker_compose, nginxproxy):
|
||||
r = nginxproxy.get("http://web1.nginx-proxy.local/port")
|
||||
r = nginxproxy.get("http://web1.nginx-proxy.example/port")
|
||||
assert r.status_code == 200
|
||||
assert r.text == "answer from port 81\n"
|
||||
assert "X-test" in r.headers
|
||||
assert "f00" == r.headers["X-test"]
|
||||
|
||||
def test_custom_default_conf_applies_to_web2(docker_compose, nginxproxy):
|
||||
r = nginxproxy.get("http://web2.nginx-proxy.local/port")
|
||||
r = nginxproxy.get("http://web2.nginx-proxy.example/port")
|
||||
assert r.status_code == 200
|
||||
assert r.text == "answer from port 82\n"
|
||||
assert "X-test" in r.headers
|
||||
@ -21,7 +21,7 @@ def test_custom_default_conf_applies_to_web2(docker_compose, nginxproxy):
|
||||
|
||||
|
||||
def test_custom_default_conf_is_overriden_for_web3(docker_compose, nginxproxy):
|
||||
r = nginxproxy.get("http://web3.nginx-proxy.local/port")
|
||||
r = nginxproxy.get("http://web3.nginx-proxy.example/port")
|
||||
assert r.status_code == 200
|
||||
assert r.text == "answer from port 83\n"
|
||||
assert "X-test" in r.headers
|
||||
|
@ -3,7 +3,7 @@ nginx-proxy:
|
||||
volumes:
|
||||
- /var/run/docker.sock:/tmp/docker.sock:ro
|
||||
- ./my_custom_proxy_settings.conf:/etc/nginx/vhost.d/default_location:ro
|
||||
- ./my_custom_proxy_settings_bar.conf:/etc/nginx/vhost.d/web3.nginx-proxy.local_location:ro
|
||||
- ./my_custom_proxy_settings_bar.conf:/etc/nginx/vhost.d/web3.nginx-proxy.example_location:ro
|
||||
|
||||
web1:
|
||||
image: web
|
||||
@ -11,7 +11,7 @@ web1:
|
||||
- "81"
|
||||
environment:
|
||||
WEB_PORTS: 81
|
||||
VIRTUAL_HOST: web1.nginx-proxy.local
|
||||
VIRTUAL_HOST: web1.nginx-proxy.example
|
||||
|
||||
web2:
|
||||
image: web
|
||||
@ -19,7 +19,7 @@ web2:
|
||||
- "82"
|
||||
environment:
|
||||
WEB_PORTS: 82
|
||||
VIRTUAL_HOST: web2.nginx-proxy.local
|
||||
VIRTUAL_HOST: web2.nginx-proxy.example
|
||||
|
||||
web3:
|
||||
image: web
|
||||
@ -27,4 +27,4 @@ web3:
|
||||
- "83"
|
||||
environment:
|
||||
WEB_PORTS: 83
|
||||
VIRTUAL_HOST: web3.nginx-proxy.local
|
||||
VIRTUAL_HOST: web3.nginx-proxy.example
|
||||
|
@ -6,14 +6,14 @@ def test_custom_conf_does_not_apply_to_unknown_vhost(docker_compose, nginxproxy)
|
||||
assert "X-test" not in r.headers
|
||||
|
||||
def test_custom_conf_applies_to_web1(docker_compose, nginxproxy):
|
||||
r = nginxproxy.get("http://web1.nginx-proxy.local/port")
|
||||
r = nginxproxy.get("http://web1.nginx-proxy.example/port")
|
||||
assert r.status_code == 200
|
||||
assert r.text == "answer from port 81\n"
|
||||
assert "X-test" in r.headers
|
||||
assert "f00" == r.headers["X-test"]
|
||||
|
||||
def test_custom_conf_applies_to_web2(docker_compose, nginxproxy):
|
||||
r = nginxproxy.get("http://web2.nginx-proxy.local/port")
|
||||
r = nginxproxy.get("http://web2.nginx-proxy.example/port")
|
||||
assert r.status_code == 200
|
||||
assert r.text == "answer from port 82\n"
|
||||
assert "X-test" in r.headers
|
||||
|
@ -12,7 +12,7 @@ services:
|
||||
- "81"
|
||||
environment:
|
||||
WEB_PORTS: 81
|
||||
VIRTUAL_HOST: web1.nginx-proxy.local
|
||||
VIRTUAL_HOST: web1.nginx-proxy.example
|
||||
|
||||
web2:
|
||||
image: web
|
||||
@ -20,4 +20,4 @@ services:
|
||||
- "82"
|
||||
environment:
|
||||
WEB_PORTS: 82
|
||||
VIRTUAL_HOST: web2.nginx-proxy.local
|
||||
VIRTUAL_HOST: web2.nginx-proxy.example
|
||||
|
@ -6,17 +6,17 @@ def test_custom_conf_does_not_apply_to_unknown_vhost(docker_compose, nginxproxy)
|
||||
assert "X-test" not in r.headers
|
||||
|
||||
def test_custom_conf_applies_to_web1(docker_compose, nginxproxy):
|
||||
r = nginxproxy.get("http://web1.nginx-proxy.local/port")
|
||||
r = nginxproxy.get("http://web1.nginx-proxy.example/port")
|
||||
assert r.status_code == 200
|
||||
assert r.text == "answer from port 81\n"
|
||||
assert "X-test" in r.headers
|
||||
assert "f00" == r.headers["X-test"]
|
||||
|
||||
def test_custom_conf_does_not_apply_to_web2(docker_compose, nginxproxy):
|
||||
r = nginxproxy.get("http://web2.nginx-proxy.local/port")
|
||||
r = nginxproxy.get("http://web2.nginx-proxy.example/port")
|
||||
assert r.status_code == 200
|
||||
assert r.text == "answer from port 82\n"
|
||||
assert "X-test" not in r.headers
|
||||
|
||||
def test_custom_block_is_present_in_nginx_generated_conf(docker_compose, nginxproxy):
|
||||
assert b"include /etc/nginx/vhost.d/web1.nginx-proxy.local_location;" in nginxproxy.get_conf()
|
||||
assert b"include /etc/nginx/vhost.d/web1.nginx-proxy.example_location;" in nginxproxy.get_conf()
|
@ -4,7 +4,7 @@ services:
|
||||
image: nginxproxy/nginx-proxy:test
|
||||
volumes:
|
||||
- /var/run/docker.sock:/tmp/docker.sock:ro
|
||||
- ./my_custom_proxy_settings.conf:/etc/nginx/vhost.d/web1.nginx-proxy.local_location:ro
|
||||
- ./my_custom_proxy_settings.conf:/etc/nginx/vhost.d/web1.nginx-proxy.example_location:ro
|
||||
|
||||
web1:
|
||||
image: web
|
||||
@ -12,7 +12,7 @@ services:
|
||||
- "81"
|
||||
environment:
|
||||
WEB_PORTS: 81
|
||||
VIRTUAL_HOST: web1.nginx-proxy.local
|
||||
VIRTUAL_HOST: web1.nginx-proxy.example
|
||||
|
||||
web2:
|
||||
image: web
|
||||
@ -20,4 +20,4 @@ services:
|
||||
- "82"
|
||||
environment:
|
||||
WEB_PORTS: 82
|
||||
VIRTUAL_HOST: web2.nginx-proxy.local
|
||||
VIRTUAL_HOST: web2.nginx-proxy.example
|
||||
|
@ -6,14 +6,14 @@ def test_custom_conf_does_not_apply_to_unknown_vhost(docker_compose, nginxproxy)
|
||||
assert "X-test" not in r.headers
|
||||
|
||||
def test_custom_conf_applies_to_web1(docker_compose, nginxproxy):
|
||||
r = nginxproxy.get("http://web1.nginx-proxy.local/port")
|
||||
r = nginxproxy.get("http://web1.nginx-proxy.example/port")
|
||||
assert r.status_code == 200
|
||||
assert r.text == "answer from port 81\n"
|
||||
assert "X-test" in r.headers
|
||||
assert "f00" == r.headers["X-test"]
|
||||
|
||||
def test_custom_conf_does_not_apply_to_web2(docker_compose, nginxproxy):
|
||||
r = nginxproxy.get("http://web2.nginx-proxy.local/port")
|
||||
r = nginxproxy.get("http://web2.nginx-proxy.example/port")
|
||||
assert r.status_code == 200
|
||||
assert r.text == "answer from port 82\n"
|
||||
assert "X-test" not in r.headers
|
||||
|
@ -4,7 +4,7 @@ services:
|
||||
image: nginxproxy/nginx-proxy:test
|
||||
volumes:
|
||||
- /var/run/docker.sock:/tmp/docker.sock:ro
|
||||
- ./my_custom_proxy_settings.conf:/etc/nginx/vhost.d/web1.nginx-proxy.local:ro
|
||||
- ./my_custom_proxy_settings.conf:/etc/nginx/vhost.d/web1.nginx-proxy.example:ro
|
||||
|
||||
web1:
|
||||
image: web
|
||||
@ -12,7 +12,7 @@ services:
|
||||
- "81"
|
||||
environment:
|
||||
WEB_PORTS: 81
|
||||
VIRTUAL_HOST: web1.nginx-proxy.local
|
||||
VIRTUAL_HOST: web1.nginx-proxy.example
|
||||
|
||||
web2:
|
||||
image: web
|
||||
@ -20,4 +20,4 @@ services:
|
||||
- "82"
|
||||
environment:
|
||||
WEB_PORTS: 82
|
||||
VIRTUAL_HOST: web2.nginx-proxy.local
|
||||
VIRTUAL_HOST: web2.nginx-proxy.example
|
||||
|
@ -6,14 +6,14 @@ def test_custom_conf_does_not_apply_to_unknown_vhost(docker_compose, nginxproxy)
|
||||
assert "X-test" not in r.headers
|
||||
|
||||
def test_custom_conf_applies_to_web1(docker_compose, nginxproxy):
|
||||
r = nginxproxy.get("http://web1.nginx-proxy.local/port")
|
||||
r = nginxproxy.get("http://web1.nginx-proxy.example/port")
|
||||
assert r.status_code == 200
|
||||
assert r.text == "answer from port 81\n"
|
||||
assert "X-test" in r.headers
|
||||
assert "f00" == r.headers["X-test"]
|
||||
|
||||
def test_custom_conf_applies_to_web2(docker_compose, nginxproxy):
|
||||
r = nginxproxy.get("http://web2.nginx-proxy.local/port")
|
||||
r = nginxproxy.get("http://web2.nginx-proxy.example/port")
|
||||
assert r.status_code == 200
|
||||
assert r.text == "answer from port 82\n"
|
||||
assert "X-test" in r.headers
|
||||
|
@ -12,7 +12,7 @@ services:
|
||||
- "81"
|
||||
environment:
|
||||
WEB_PORTS: 81
|
||||
VIRTUAL_HOST: web1.nginx-proxy.local
|
||||
VIRTUAL_HOST: web1.nginx-proxy.example
|
||||
|
||||
web2:
|
||||
image: web
|
||||
@ -20,4 +20,4 @@ services:
|
||||
- "82"
|
||||
environment:
|
||||
WEB_PORTS: 82
|
||||
VIRTUAL_HOST: web2.nginx-proxy.local
|
||||
VIRTUAL_HOST: web2.nginx-proxy.example
|
||||
|
Reference in New Issue
Block a user