1
0
Fork 0
mirror of https://github.com/nginx-proxy/nginx-proxy synced 2024-05-06 15:46:09 +02:00

tests: keepalive auto setting

This commit is contained in:
Nicolas Duchon 2023-12-26 19:07:09 +01:00
parent 443ee5202c
commit 2aa35aa637
2 changed files with 21 additions and 0 deletions

View File

@ -27,6 +27,14 @@ def test_keepalive_enabled(docker_compose, nginxproxy):
assert r.status_code == 200
assert not re.search(fr'(?m)^(?i:Connection):', r.text)
def test_keepalive_auto_enabled(docker_compose, nginxproxy):
conf = nginxproxy.get_conf().decode('ASCII')
assert re.search(r"keepalive 8\;", conf)
r = nginxproxy.get("http://keepalive-auto.nginx-proxy.test/headers")
assert r.status_code == 200
assert not re.search(fr'(?m)^(?i:Connection):', r.text)
def test_keepalive_enabled_other_headers_ok(docker_compose, nginxproxy):
"""See the docstring for the disabled case above."""
r = nginxproxy.get("http://keepalive-enabled.nginx-proxy.test/headers")

View File

@ -18,6 +18,19 @@ services:
VIRTUAL_HOST: keepalive-enabled.nginx-proxy.test
labels:
com.github.nginx-proxy.nginx-proxy.keepalive: "64"
keepalive-auto:
image: web
deploy:
mode: replicated
replicas: 4
expose:
- "80"
environment:
WEB_PORTS: 80
VIRTUAL_HOST: keepalive-auto.nginx-proxy.test
labels:
com.github.nginx-proxy.nginx-proxy.keepalive: "auto"
sut:
image: nginxproxy/nginx-proxy:test