Преглед изворни кода

ci: ensure all compose files are valid compose v2 + formatting

Nicolas Duchon пре 1 година
родитељ
комит
060f09cfce
69 измењених фајлова са 894 додато и 752 уклоњено
  1. 2 1
      docker-compose-separate-containers.yml
  2. 2 1
      docker-compose.yml
  3. 15 13
      test/stress_tests/test_deleted_cert/docker-compose.yml
  4. 0 1
      test/stress_tests/test_unreachable_network/docker-compose.yml
  5. 22 20
      test/test_DOCKER_HOST_unix_socket.yml
  6. 2 1
      test/test_composev2.yml
  7. 30 27
      test/test_custom/test_defaults-location.yml
  8. 2 1
      test/test_custom/test_defaults.yml
  9. 2 1
      test/test_custom/test_location-per-vhost.yml
  10. 2 1
      test/test_custom/test_per-vhost.yml
  11. 2 1
      test/test_custom/test_proxy-wide.yml
  12. 17 15
      test/test_default-host.yml
  13. 3 0
      test/test_default-root-none.yml
  14. 1 1
      test/test_dockergen/test_dockergen_v2.yml
  15. 2 1
      test/test_dockergen/test_dockergen_v3.yml
  16. 7 4
      test/test_events.yml
  17. 3 0
      test/test_fallback.data/custom-fallback.yml
  18. 6 0
      test/test_fallback.data/nodefault.yml
  19. 3 0
      test/test_fallback.data/nohttp-on-app.yml
  20. 4 0
      test/test_fallback.data/nohttp-with-missing-cert.yml
  21. 3 0
      test/test_fallback.data/nohttp.yml
  22. 3 0
      test/test_fallback.data/nohttps-on-app.yml
  23. 3 0
      test/test_fallback.data/nohttps.yml
  24. 6 0
      test/test_fallback.data/withdefault.yml
  25. 21 19
      test/test_headers/test_http.yml
  26. 27 25
      test/test_headers/test_https.yml
  27. 2 0
      test/test_http2/test_http2_global_disabled.yml
  28. 3 1
      test/test_http3/test_http3_global_disabled.yml
  29. 2 0
      test/test_http3/test_http3_global_enabled.yml
  30. 2 0
      test/test_http3/test_http3_vhost.yml
  31. 16 13
      test/test_http_port.yml
  32. 22 20
      test/test_internal/test_internal-per-vhost.yml
  33. 26 24
      test/test_internal/test_internal-per-vpath.yml
  34. 1 2
      test/test_ipv6.yml
  35. 24 22
      test/test_keepalive.yml
  36. 2 0
      test/test_loadbalancing.yml
  37. 2 0
      test/test_location-override.yml
  38. 17 14
      test/test_log_format.yml
  39. 13 11
      test/test_multiple-hosts.yml
  40. 1 1
      test/test_multiple-networks.yml
  41. 14 12
      test/test_multiple-ports/test_VIRTUAL_PORT-single-different-from-single-port.yml
  42. 16 13
      test/test_multiple-ports/test_VIRTUAL_PORT.yml
  43. 15 12
      test/test_multiple-ports/test_default-80.yml
  44. 13 11
      test/test_multiple-ports/test_single-port-not-80.yml
  45. 1 2
      test/test_nominal.yml
  46. 2 2
      test/test_raw-ip-vhost.yml
  47. 29 26
      test/test_server-down/test_load-balancing.yml
  48. 14 11
      test/test_server-down/test_no-server-down.yml
  49. 15 12
      test/test_server-down/test_server-down.yml
  50. 67 65
      test/test_ssl/test_dhparam.yml
  51. 49 46
      test/test_ssl/test_hsts.yml
  52. 18 15
      test/test_ssl/test_https_port.yml
  53. 15 13
      test/test_ssl/test_nohttp.yml
  54. 14 12
      test/test_ssl/test_nohttps.yml
  55. 15 13
      test/test_ssl/test_noredirect.yml
  56. 25 23
      test/test_ssl/test_virtual_path.yml
  57. 15 12
      test/test_ssl/test_wildcard.yml
  58. 16 14
      test/test_trust-downstream-proxy/test_default.yml
  59. 18 16
      test/test_trust-downstream-proxy/test_disabled.yml
  60. 18 16
      test/test_trust-downstream-proxy/test_enabled.yml
  61. 1 1
      test/test_upstream-name/test_predictable-name.yml
  62. 1 1
      test/test_upstream-name/test_sha1-name.yml
  63. 6 0
      test/test_vhost-empty-string.yml
  64. 1 1
      test/test_vhost-in-multiple-networks.yml
  65. 44 43
      test/test_virtual-path/test_custom_conf.yml
  66. 19 16
      test/test_virtual-path/test_forwarding.yml
  67. 37 34
      test/test_virtual-path/test_location_precedence.yml
  68. 39 37
      test/test_virtual-path/test_virtual_paths.yml
  69. 34 32
      test/test_wildcard_host.yml

+ 2 - 1
docker-compose-separate-containers.yml

@@ -1,4 +1,5 @@
-version: '2'
+version: "2"
+
 services:
   nginx:
     image: nginx

+ 2 - 1
docker-compose.yml

@@ -1,4 +1,5 @@
-version: '2'
+version: "2"
+
 services:
   nginx-proxy:
     image: nginxproxy/nginx-proxy

+ 15 - 13
test/stress_tests/test_deleted_cert/docker-compose.yml

@@ -1,15 +1,17 @@
-web:
-  image: web
-  expose:
-  - "81"
-  environment:
-    WEB_PORTS: 81
-    VIRTUAL_HOST: web.nginx-proxy
+version: "2"
 
+services:
+  web:
+    image: web
+    expose:
+      - "81"
+    environment:
+      WEB_PORTS: 81
+      VIRTUAL_HOST: web.nginx-proxy
 
-reverseproxy:
-  image: nginxproxy/nginx-proxy:test
-  container_name: reverseproxy
-  volumes:
-  - /var/run/docker.sock:/tmp/docker.sock:ro
-  - ./tmp_certs:/etc/nginx/certs:ro
+  reverseproxy:
+    image: nginxproxy/nginx-proxy:test
+    container_name: reverseproxy
+    volumes:
+      - /var/run/docker.sock:/tmp/docker.sock:ro
+      - ./tmp_certs:/etc/nginx/certs:ro

+ 0 - 1
test/stress_tests/test_unreachable_network/docker-compose.yml

@@ -32,4 +32,3 @@ services:
     environment:
       WEB_PORTS: 82
       VIRTUAL_HOST: webB.nginx-proxy
-

+ 22 - 20
test/test_DOCKER_HOST_unix_socket.yml

@@ -1,23 +1,25 @@
-web1:
-  image: web
-  expose:
-    - "81"
-  environment:
-    WEB_PORTS: 81
-    VIRTUAL_HOST: web1.nginx-proxy.tld
+version: "2"
 
-web2:
-  image: web
-  expose:
-    - "82"
-  environment:
-    WEB_PORTS: 82
-    VIRTUAL_HOST: web2.nginx-proxy.tld
+services:
+  web1:
+    image: web
+    expose:
+      - "81"
+    environment:
+      WEB_PORTS: 81
+      VIRTUAL_HOST: web1.nginx-proxy.tld
 
+  web2:
+    image: web
+    expose:
+      - "82"
+    environment:
+      WEB_PORTS: 82
+      VIRTUAL_HOST: web2.nginx-proxy.tld
 
-sut:
-  image: nginxproxy/nginx-proxy:test
-  volumes:
-    - /var/run/docker.sock:/f00.sock:ro
-  environment:
-    DOCKER_HOST: unix:///f00.sock
+  sut:
+    image: nginxproxy/nginx-proxy:test
+    volumes:
+      - /var/run/docker.sock:/f00.sock:ro
+    environment:
+      DOCKER_HOST: unix:///f00.sock

+ 2 - 1
test/test_composev2.yml

@@ -1,4 +1,5 @@
-version: '2'
+version: "2"
+
 services:
   nginx-proxy:
     image: nginxproxy/nginx-proxy:test

+ 30 - 27
test/test_custom/test_defaults-location.yml

@@ -1,30 +1,33 @@
-nginx-proxy:
-  image: nginxproxy/nginx-proxy:test
-  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.example_location:ro
+version: "2"
 
-web1:
-  image: web
-  expose:
-    - "81"
-  environment:
-    WEB_PORTS: 81
-    VIRTUAL_HOST: web1.nginx-proxy.example
+services:
+  nginx-proxy:
+    image: nginxproxy/nginx-proxy:test
+    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.example_location:ro
 
-web2:
-  image: web
-  expose:
-    - "82"
-  environment:
-    WEB_PORTS: 82
-    VIRTUAL_HOST: web2.nginx-proxy.example
+  web1:
+    image: web
+    expose:
+      - "81"
+    environment:
+      WEB_PORTS: 81
+      VIRTUAL_HOST: web1.nginx-proxy.example
 
-web3:
-  image: web
-  expose:
-    - "83"
-  environment:
-    WEB_PORTS: 83
-    VIRTUAL_HOST: web3.nginx-proxy.example
+  web2:
+    image: web
+    expose:
+      - "82"
+    environment:
+      WEB_PORTS: 82
+      VIRTUAL_HOST: web2.nginx-proxy.example
+
+  web3:
+    image: web
+    expose:
+      - "83"
+    environment:
+      WEB_PORTS: 83
+      VIRTUAL_HOST: web3.nginx-proxy.example

+ 2 - 1
test/test_custom/test_defaults.yml

@@ -1,4 +1,5 @@
-version: '2'
+version: "2"
+
 services:
   nginx-proxy:
     image: nginxproxy/nginx-proxy:test

+ 2 - 1
test/test_custom/test_location-per-vhost.yml

@@ -1,4 +1,5 @@
-version: '2'
+version: "2"
+
 services:
   nginx-proxy:
     image: nginxproxy/nginx-proxy:test

+ 2 - 1
test/test_custom/test_per-vhost.yml

@@ -1,4 +1,5 @@
-version: '2'
+version: "2"
+
 services:
   nginx-proxy:
     image: nginxproxy/nginx-proxy:test

+ 2 - 1
test/test_custom/test_proxy-wide.yml

@@ -1,4 +1,5 @@
-version: '2'
+version: "2"
+
 services:
   nginx-proxy:
     image: nginxproxy/nginx-proxy:test

+ 17 - 15
test/test_default-host.yml

@@ -1,17 +1,19 @@
-# GIVEN a webserver with VIRTUAL_HOST set to web1.tld
-web1:
-  image: web
-  expose:
-    - "81"
-  environment:
-    WEB_PORTS: 81
-    VIRTUAL_HOST: web1.tld
+version: "2"
 
+services:
+  # GIVEN a webserver with VIRTUAL_HOST set to web1.tld
+  web1:
+    image: web
+    expose:
+      - "81"
+    environment:
+      WEB_PORTS: 81
+      VIRTUAL_HOST: web1.tld
 
-# WHEN nginx-proxy runs with DEFAULT_HOST set to web1.tld
-sut:
-  image: nginxproxy/nginx-proxy:test
-  volumes:
-    - /var/run/docker.sock:/tmp/docker.sock:ro
-  environment:
-    DEFAULT_HOST: web1.tld
+  # WHEN nginx-proxy runs with DEFAULT_HOST set to web1.tld
+  sut:
+    image: nginxproxy/nginx-proxy:test
+    volumes:
+      - /var/run/docker.sock:/tmp/docker.sock:ro
+    environment:
+      DEFAULT_HOST: web1.tld

+ 3 - 0
test/test_default-root-none.yml

@@ -1,3 +1,5 @@
+version: "2"
+
 services:
   sut:
     image: nginxproxy/nginx-proxy:test
@@ -5,6 +7,7 @@ services:
       - /var/run/docker.sock:/tmp/docker.sock:ro
     environment:
       DEFAULT_ROOT: none
+
   web:
     image: web
     expose:

+ 1 - 1
test/test_dockergen/test_dockergen_v2.yml

@@ -1,4 +1,4 @@
-version: '2'
+version: "2"
 
 services:
   nginx:

+ 2 - 1
test/test_dockergen/test_dockergen_v3.yml

@@ -1,4 +1,5 @@
-version: '3'
+version: "3"
+
 services:
   nginx:
     image: nginx

+ 7 - 4
test/test_events.yml

@@ -1,4 +1,7 @@
-nginxproxy:
-  image: nginxproxy/nginx-proxy:test
-  volumes:
-    - /var/run/docker.sock:/tmp/docker.sock:ro
+version: "2"
+
+services:
+  nginxproxy:
+    image: nginxproxy/nginx-proxy:test
+    volumes:
+      - /var/run/docker.sock:/tmp/docker.sock:ro

+ 3 - 0
test/test_fallback.data/custom-fallback.yml

@@ -1,9 +1,12 @@
+version: "2"
+
 services:
   sut:
     image: nginxproxy/nginx-proxy:test
     volumes:
       - /var/run/docker.sock:/tmp/docker.sock:ro
       - ./custom-fallback.conf:/etc/nginx/conf.d/zzz-custom-fallback.conf:ro
+
   http-only:
     image: web
     expose:

+ 6 - 0
test/test_fallback.data/nodefault.yml

@@ -1,9 +1,12 @@
+version: "2"
+
 services:
   sut:
     image: nginxproxy/nginx-proxy:test
     volumes:
       - /var/run/docker.sock:/tmp/docker.sock:ro
       - ./nodefault.certs:/etc/nginx/certs:ro
+
   https-and-http:
     image: web
     expose:
@@ -11,6 +14,7 @@ services:
     environment:
       WEB_PORTS: "81"
       VIRTUAL_HOST: https-and-http.nginx-proxy.test
+
   https-only:
     image: web
     expose:
@@ -19,6 +23,7 @@ services:
       WEB_PORTS: "82"
       VIRTUAL_HOST: https-only.nginx-proxy.test
       HTTPS_METHOD: nohttp
+
   http-only:
     image: web
     expose:
@@ -27,6 +32,7 @@ services:
       WEB_PORTS: "83"
       VIRTUAL_HOST: http-only.nginx-proxy.test
       HTTPS_METHOD: nohttps
+
   missing-cert:
     image: web
     expose:

+ 3 - 0
test/test_fallback.data/nohttp-on-app.yml

@@ -1,3 +1,5 @@
+version: "2"
+
 services:
   sut:
     image: nginxproxy/nginx-proxy:test
@@ -6,6 +8,7 @@ services:
       - ./withdefault.certs:/etc/nginx/certs:ro
     environment:
       HTTPS_METHOD: redirect
+
   https-only:
     image: web
     expose:

+ 4 - 0
test/test_fallback.data/nohttp-with-missing-cert.yml

@@ -1,3 +1,5 @@
+version: "2"
+
 services:
   sut:
     image: nginxproxy/nginx-proxy:test
@@ -6,6 +8,7 @@ services:
       - ./withdefault.certs:/etc/nginx/certs:ro
     environment:
       HTTPS_METHOD: nohttp
+
   https-only:
     image: web
     expose:
@@ -13,6 +16,7 @@ services:
     environment:
       WEB_PORTS: "82"
       VIRTUAL_HOST: https-only.nginx-proxy.test
+
   missing-cert:
     image: web
     expose:

+ 3 - 0
test/test_fallback.data/nohttp.yml

@@ -1,3 +1,5 @@
+version: "2"
+
 services:
   sut:
     image: nginxproxy/nginx-proxy:test
@@ -6,6 +8,7 @@ services:
       - ./withdefault.certs:/etc/nginx/certs:ro
     environment:
       HTTPS_METHOD: nohttp
+
   https-only:
     image: web
     expose:

+ 3 - 0
test/test_fallback.data/nohttps-on-app.yml

@@ -1,3 +1,5 @@
+version: "2"
+
 services:
   sut:
     image: nginxproxy/nginx-proxy:test
@@ -5,6 +7,7 @@ services:
       - /var/run/docker.sock:/tmp/docker.sock:ro
     environment:
       HTTPS_METHOD: redirect
+
   http-only:
     image: web
     expose:

+ 3 - 0
test/test_fallback.data/nohttps.yml

@@ -1,3 +1,5 @@
+version: "2"
+
 services:
   sut:
     image: nginxproxy/nginx-proxy:test
@@ -5,6 +7,7 @@ services:
       - /var/run/docker.sock:/tmp/docker.sock:ro
     environment:
       HTTPS_METHOD: nohttps
+
   http-only:
     image: web
     expose:

+ 6 - 0
test/test_fallback.data/withdefault.yml

@@ -1,9 +1,12 @@
+version: "2"
+
 services:
   sut:
     image: nginxproxy/nginx-proxy:test
     volumes:
       - /var/run/docker.sock:/tmp/docker.sock:ro
       - ./withdefault.certs:/etc/nginx/certs:ro
+
   https-and-http:
     image: web
     expose:
@@ -11,6 +14,7 @@ services:
     environment:
       WEB_PORTS: "81"
       VIRTUAL_HOST: https-and-http.nginx-proxy.test
+
   https-only:
     image: web
     expose:
@@ -19,6 +23,7 @@ services:
       WEB_PORTS: "82"
       VIRTUAL_HOST: https-only.nginx-proxy.test
       HTTPS_METHOD: nohttp
+
   http-only:
     image: web
     expose:
@@ -27,6 +32,7 @@ services:
       WEB_PORTS: "83"
       VIRTUAL_HOST: http-only.nginx-proxy.test
       HTTPS_METHOD: nohttps
+
   missing-cert:
     image: web
     expose:

+ 21 - 19
test/test_headers/test_http.yml

@@ -1,22 +1,24 @@
-web:
-  image: web
-  expose:
-    - "80"
-  environment:
-    WEB_PORTS: 80
-    VIRTUAL_HOST: web.nginx-proxy.tld
+version: "2"
 
-web-server-tokens-off:
-  image: web
-  expose:
-    - "80"
-  environment:
-    WEB_PORTS: 80
-    VIRTUAL_HOST: web-server-tokens-off.nginx-proxy.tld
-    SERVER_TOKENS: "off"
+services:
+  web:
+    image: web
+    expose:
+      - "80"
+    environment:
+      WEB_PORTS: 80
+      VIRTUAL_HOST: web.nginx-proxy.tld
 
+  web-server-tokens-off:
+    image: web
+    expose:
+      - "80"
+    environment:
+      WEB_PORTS: 80
+      VIRTUAL_HOST: web-server-tokens-off.nginx-proxy.tld
+      SERVER_TOKENS: "off"
 
-sut:
-  image: nginxproxy/nginx-proxy:test
-  volumes:
-    - /var/run/docker.sock:/tmp/docker.sock:ro
+  sut:
+    image: nginxproxy/nginx-proxy:test
+    volumes:
+      - /var/run/docker.sock:/tmp/docker.sock:ro

+ 27 - 25
test/test_headers/test_https.yml

@@ -1,28 +1,30 @@
-web:
-  image: web
-  expose:
-    - "80"
-  environment:
-    WEB_PORTS: 80
-    VIRTUAL_HOST: web.nginx-proxy.tld
+version: "2"
 
-web-server-tokens-off:
-  image: web
-  expose:
-    - "80"
-  environment:
-    WEB_PORTS: 80
-    VIRTUAL_HOST: web-server-tokens-off.nginx-proxy.tld
-    SERVER_TOKENS: "off"
+services:
+  web:
+    image: web
+    expose:
+      - "80"
+    environment:
+      WEB_PORTS: 80
+      VIRTUAL_HOST: web.nginx-proxy.tld
 
+  web-server-tokens-off:
+    image: web
+    expose:
+      - "80"
+    environment:
+      WEB_PORTS: 80
+      VIRTUAL_HOST: web-server-tokens-off.nginx-proxy.tld
+      SERVER_TOKENS: "off"
 
-sut:
-  image: nginxproxy/nginx-proxy:test
-  volumes:
-    - /var/run/docker.sock:/tmp/docker.sock:ro
-    - ./certs/web.nginx-proxy.tld.crt:/etc/nginx/certs/default.crt:ro
-    - ./certs/web.nginx-proxy.tld.key:/etc/nginx/certs/default.key:ro
-    - ./certs/web.nginx-proxy.tld.crt:/etc/nginx/certs/web.nginx-proxy.tld.crt:ro
-    - ./certs/web.nginx-proxy.tld.key:/etc/nginx/certs/web.nginx-proxy.tld.key:ro
-    - ./certs/web-server-tokens-off.nginx-proxy.tld.crt:/etc/nginx/certs/web-server-tokens-off.nginx-proxy.tld.crt:ro
-    - ./certs/web-server-tokens-off.nginx-proxy.tld.key:/etc/nginx/certs/web-server-tokens-off.nginx-proxy.tld.key:ro
+  sut:
+    image: nginxproxy/nginx-proxy:test
+    volumes:
+      - /var/run/docker.sock:/tmp/docker.sock:ro
+      - ./certs/web.nginx-proxy.tld.crt:/etc/nginx/certs/default.crt:ro
+      - ./certs/web.nginx-proxy.tld.key:/etc/nginx/certs/default.key:ro
+      - ./certs/web.nginx-proxy.tld.crt:/etc/nginx/certs/web.nginx-proxy.tld.crt:ro
+      - ./certs/web.nginx-proxy.tld.key:/etc/nginx/certs/web.nginx-proxy.tld.key:ro
+      - ./certs/web-server-tokens-off.nginx-proxy.tld.crt:/etc/nginx/certs/web-server-tokens-off.nginx-proxy.tld.crt:ro
+      - ./certs/web-server-tokens-off.nginx-proxy.tld.key:/etc/nginx/certs/web-server-tokens-off.nginx-proxy.tld.key:ro

+ 2 - 0
test/test_http2/test_http2_global_disabled.yml

@@ -1,3 +1,5 @@
+version: "2"
+
 services:
   http2-global-disabled:
     image: web

+ 3 - 1
test/test_http3/test_http3_global_disabled.yml

@@ -1,3 +1,5 @@
+version: "2"
+
 services:
   http3-global-disabled:
     image: web
@@ -12,4 +14,4 @@ services:
     volumes:
       - /var/run/docker.sock:/tmp/docker.sock:ro
     #environment:
-      #ENABLE_HTTP3: "false"    #Disabled by default
+    #ENABLE_HTTP3: "false"    #Disabled by default

+ 2 - 0
test/test_http3/test_http3_global_enabled.yml

@@ -1,3 +1,5 @@
+version: "2"
+
 services:
   http3-global-enabled:
     image: web

+ 2 - 0
test/test_http3/test_http3_vhost.yml

@@ -1,3 +1,5 @@
+version: "2"
+
 services:
   http3-vhost-enabled:
     image: web

+ 16 - 13
test/test_http_port.yml

@@ -1,14 +1,17 @@
-web1:
-  image: web
-  expose:
-    - "81"
-  environment:
-    WEB_PORTS: "81"
-    VIRTUAL_HOST: "*.nginx-proxy.tld"
+version: "2"
 
-sut:
-  image: nginxproxy/nginx-proxy:test
-  volumes:
-    - /var/run/docker.sock:/tmp/docker.sock:ro
-  environment:
-    HTTP_PORT: 8080
+services:
+  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
+    environment:
+      HTTP_PORT: 8080

+ 22 - 20
test/test_internal/test_internal-per-vhost.yml

@@ -1,23 +1,25 @@
-web1:
-  image: web
-  expose:
-    - "81"
-  environment:
-    WEB_PORTS: 81
-    VIRTUAL_HOST: web1.nginx-proxy.example
-    NETWORK_ACCESS: internal
+version: "2"
 
-web2:
-  image: web
-  expose:
-    - "82"
-  environment:
-    WEB_PORTS: 82
-    VIRTUAL_HOST: web2.nginx-proxy.example
+services:
+  web1:
+    image: web
+    expose:
+      - "81"
+    environment:
+      WEB_PORTS: 81
+      VIRTUAL_HOST: web1.nginx-proxy.example
+      NETWORK_ACCESS: internal
 
-sut:
-  image: nginxproxy/nginx-proxy:test
-  volumes:
-    - /var/run/docker.sock:/tmp/docker.sock:ro
-    - ./network_internal.conf:/etc/nginx/network_internal.conf:ro
+  web2:
+    image: web
+    expose:
+      - "82"
+    environment:
+      WEB_PORTS: 82
+      VIRTUAL_HOST: web2.nginx-proxy.example
 
+  sut:
+    image: nginxproxy/nginx-proxy:test
+    volumes:
+      - /var/run/docker.sock:/tmp/docker.sock:ro
+      - ./network_internal.conf:/etc/nginx/network_internal.conf:ro

+ 26 - 24
test/test_internal/test_internal-per-vpath.yml

@@ -1,27 +1,29 @@
-web1:
-  image: web
-  expose:
-    - "81"
-  environment:
-    WEB_PORTS: 81
-    VIRTUAL_HOST: nginx-proxy.example
-    VIRTUAL_PATH: /web1/
-    VIRTUAL_DEST: /
-    NETWORK_ACCESS: internal
+version: "2"
 
-web2:
-  image: web
-  expose:
-    - "82"
-  environment:
-    WEB_PORTS: 82
-    VIRTUAL_HOST: nginx-proxy.example
-    VIRTUAL_PATH: /web2/
-    VIRTUAL_DEST: /
+services:
+  web1:
+    image: web
+    expose:
+      - "81"
+    environment:
+      WEB_PORTS: 81
+      VIRTUAL_HOST: nginx-proxy.example
+      VIRTUAL_PATH: /web1/
+      VIRTUAL_DEST: /
+      NETWORK_ACCESS: internal
 
-sut:
-  image: nginxproxy/nginx-proxy:test
-  volumes:
-    - /var/run/docker.sock:/tmp/docker.sock:ro
-    - ./network_internal.conf:/etc/nginx/network_internal.conf:ro
+  web2:
+    image: web
+    expose:
+      - "82"
+    environment:
+      WEB_PORTS: 82
+      VIRTUAL_HOST: nginx-proxy.example
+      VIRTUAL_PATH: /web2/
+      VIRTUAL_DEST: /
 
+  sut:
+    image: nginxproxy/nginx-proxy:test
+    volumes:
+      - /var/run/docker.sock:/tmp/docker.sock:ro
+      - ./network_internal.conf:/etc/nginx/network_internal.conf:ro

+ 1 - 2
test/test_ipv6.yml

@@ -1,4 +1,4 @@
-version: '2'
+version: "2"
 
 networks:
   net1:
@@ -28,7 +28,6 @@ services:
     networks:
       - net1
 
-
   sut:
     image: nginxproxy/nginx-proxy:test
     volumes:

+ 24 - 22
test/test_keepalive.yml

@@ -1,25 +1,27 @@
-keepalive-disabled:
-  image: web
-  expose:
-    - "80"
-  environment:
-    WEB_PORTS: 80
-    VIRTUAL_HOST: keepalive-disabled.nginx-proxy.test
+version: "2"
 
-keepalive-enabled:
-  image: web
-  expose:
-    - "80"
-  environment:
-    WEB_PORTS: 80
-    VIRTUAL_HOST: keepalive-enabled.nginx-proxy.test
-  labels:
-    com.github.nginx-proxy.nginx-proxy.keepalive: "64"
+services:
+  keepalive-disabled:
+    image: web
+    expose:
+      - "80"
+    environment:
+      WEB_PORTS: 80
+      VIRTUAL_HOST: keepalive-disabled.nginx-proxy.test
 
+  keepalive-enabled:
+    image: web
+    expose:
+      - "80"
+    environment:
+      WEB_PORTS: 80
+      VIRTUAL_HOST: keepalive-enabled.nginx-proxy.test
+    labels:
+      com.github.nginx-proxy.nginx-proxy.keepalive: "64"
 
-sut:
-  image: nginxproxy/nginx-proxy:test
-  volumes:
-    - /var/run/docker.sock:/tmp/docker.sock:ro
-  environment:
-    HTTPS_METHOD: nohttps
+  sut:
+    image: nginxproxy/nginx-proxy:test
+    volumes:
+      - /var/run/docker.sock:/tmp/docker.sock:ro
+    environment:
+      HTTPS_METHOD: nohttps

+ 2 - 0
test/test_loadbalancing.yml

@@ -1,3 +1,5 @@
+version: "2"
+
 services:
   loadbalance-hash:
     image: web

+ 2 - 0
test/test_location-override.yml

@@ -1,3 +1,5 @@
+version: "2"
+
 services:
   sut:
     image: nginxproxy/nginx-proxy:test

+ 17 - 14
test/test_log_format.yml

@@ -1,15 +1,18 @@
-web1:
-  image: web
-  expose:
-    - "81"
-  environment:
-    WEB_PORTS: 81
-    VIRTUAL_HOST: nginx-proxy.test
+version: "2"
 
-sut:
-  container_name: sut
-  image: nginxproxy/nginx-proxy:test
-  volumes:
-    - /var/run/docker.sock:/tmp/docker.sock:ro
-  environment:
-    LOG_FORMAT: "$$remote_addr - $$remote_user [$$time_local] \"$$request\" $$status $$body_bytes_sent \"$$http_referer\" \"$$http_user_agent\" request_time=$$request_time $$upstream_response_time"
+services:
+  web1:
+    image: web
+    expose:
+      - "81"
+    environment:
+      WEB_PORTS: 81
+      VIRTUAL_HOST: nginx-proxy.test
+
+  sut:
+    container_name: sut
+    image: nginxproxy/nginx-proxy:test
+    volumes:
+      - /var/run/docker.sock:/tmp/docker.sock:ro
+    environment:
+      LOG_FORMAT: '$$remote_addr - $$remote_user [$$time_local] "$$request" $$status $$body_bytes_sent "$$http_referer" "$$http_user_agent" request_time=$$request_time $$upstream_response_time'

+ 13 - 11
test/test_multiple-hosts.yml

@@ -1,13 +1,15 @@
-web:
-  image: web
-  expose:
-    - "81"
-  environment:
-    WEB_PORTS: 81
-    VIRTUAL_HOST: webA.nginx-proxy.tld,webB.nginx-proxy.tld
+version: "2"
 
+services:
+  web:
+    image: web
+    expose:
+      - "81"
+    environment:
+      WEB_PORTS: 81
+      VIRTUAL_HOST: webA.nginx-proxy.tld,webB.nginx-proxy.tld
 
-sut:
-  image: nginxproxy/nginx-proxy:test
-  volumes:
-    - /var/run/docker.sock:/tmp/docker.sock:ro
+  sut:
+    image: nginxproxy/nginx-proxy:test
+    volumes:
+      - /var/run/docker.sock:/tmp/docker.sock:ro

+ 1 - 1
test/test_multiple-networks.yml

@@ -1,4 +1,4 @@
-version: '2'
+version: "2"
 
 networks:
   net1: {}

+ 14 - 12
test/test_multiple-ports/test_VIRTUAL_PORT-single-different-from-single-port.yml

@@ -1,14 +1,16 @@
-web:
-  image: web
-  expose:
-    - "81"
-  environment:
-    WEB_PORTS: "81"
-    VIRTUAL_HOST: "web.nginx-proxy.tld"
-    VIRTUAL_PORT: "90"
+version: "2"
 
+services:
+  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
+  sut:
+    image: nginxproxy/nginx-proxy:test
+    volumes:
+      - /var/run/docker.sock:/tmp/docker.sock:ro

+ 16 - 13
test/test_multiple-ports/test_VIRTUAL_PORT.yml

@@ -1,14 +1,17 @@
-web:
-  image: web
-  expose:
-    - "80"
-    - "90"
-  environment:
-    WEB_PORTS: "80 90"
-    VIRTUAL_HOST: "web.nginx-proxy.tld"
-    VIRTUAL_PORT: 90
+version: "2"
 
-sut:
-  image: nginxproxy/nginx-proxy:test
-  volumes:
-    - /var/run/docker.sock:/tmp/docker.sock:ro
+services:
+  web:
+    image: web
+    expose:
+      - "80"
+      - "90"
+    environment:
+      WEB_PORTS: "80 90"
+      VIRTUAL_HOST: "web.nginx-proxy.tld"
+      VIRTUAL_PORT: 90
+
+  sut:
+    image: nginxproxy/nginx-proxy:test
+    volumes:
+      - /var/run/docker.sock:/tmp/docker.sock:ro

+ 15 - 12
test/test_multiple-ports/test_default-80.yml

@@ -1,13 +1,16 @@
-web:
-  image: web
-  expose:
-    - "80"
-    - "81"
-  environment:
-    WEB_PORTS: "80 81"
-    VIRTUAL_HOST: "web.nginx-proxy.tld"
+version: "2"
 
-sut:
-  image: nginxproxy/nginx-proxy:test
-  volumes:
-    - /var/run/docker.sock:/tmp/docker.sock:ro
+services:
+  web:
+    image: web
+    expose:
+      - "80"
+      - "81"
+    environment:
+      WEB_PORTS: "80 81"
+      VIRTUAL_HOST: "web.nginx-proxy.tld"
+
+  sut:
+    image: nginxproxy/nginx-proxy:test
+    volumes:
+      - /var/run/docker.sock:/tmp/docker.sock:ro

+ 13 - 11
test/test_multiple-ports/test_single-port-not-80.yml

@@ -1,13 +1,15 @@
-web:
-  image: web
-  expose:
-    - "81"
-  environment:
-    WEB_PORTS: "81"
-    VIRTUAL_HOST: "web.nginx-proxy.tld"
+version: "2"
 
+services:
+  web:
+    image: web
+    expose:
+      - "81"
+    environment:
+      WEB_PORTS: "81"
+      VIRTUAL_HOST: "web.nginx-proxy.tld"
 
-sut:
-  image: nginxproxy/nginx-proxy:test
-  volumes:
-    - /var/run/docker.sock:/tmp/docker.sock:ro
+  sut:
+    image: nginxproxy/nginx-proxy:test
+    volumes:
+      - /var/run/docker.sock:/tmp/docker.sock:ro

+ 1 - 2
test/test_nominal.yml

@@ -1,4 +1,4 @@
-version: '2'
+version: "2"
 
 networks:
   net1:
@@ -28,7 +28,6 @@ services:
     networks:
       - net1
 
-
   sut:
     image: nginxproxy/nginx-proxy:test
     volumes:

+ 2 - 2
test/test_raw-ip-vhost.yml

@@ -1,4 +1,4 @@
-version: '2'
+version: "2"
 
 networks:
   net1:
@@ -6,7 +6,7 @@ networks:
     ipam:
       config:
         - subnet: 172.20.0.0/16
-        - subnet: fd00::/80  
+        - subnet: fd00::/80
 
 services:
   web1:

+ 29 - 26
test/test_server-down/test_load-balancing.yml

@@ -1,29 +1,32 @@
-web1:
-  image: web
-  expose:
-    - "81"
-  environment:
-    WEB_PORTS: 81
-    VIRTUAL_HOST: web.nginx-proxy.tld
+version: "2"
 
-web2:
-  image: web
-  expose:
-    - "82"
-  environment:
-    WEB_PORTS: 83
-    VIRTUAL_HOST: web.nginx-proxy.tld
+services:
+  web1:
+    image: web
+    expose:
+      - "81"
+    environment:
+      WEB_PORTS: 81
+      VIRTUAL_HOST: web.nginx-proxy.tld
 
-web3:
-  image: web
-  expose:
-    - "83"
-  environment:
-    WEB_PORTS: 83
-    VIRTUAL_HOST: web.nginx-proxy.tld
-  net: "none"
+  web2:
+    image: web
+    expose:
+      - "82"
+    environment:
+      WEB_PORTS: 83
+      VIRTUAL_HOST: web.nginx-proxy.tld
 
-sut:
-  image: nginxproxy/nginx-proxy:test
-  volumes:
-    - /var/run/docker.sock:/tmp/docker.sock:ro
+  web3:
+    image: web
+    expose:
+      - "83"
+    environment:
+      WEB_PORTS: 83
+      VIRTUAL_HOST: web.nginx-proxy.tld
+    net: "none"
+
+  sut:
+    image: nginxproxy/nginx-proxy:test
+    volumes:
+      - /var/run/docker.sock:/tmp/docker.sock:ro

+ 14 - 11
test/test_server-down/test_no-server-down.yml

@@ -1,12 +1,15 @@
-web:
-  image: web
-  expose:
-    - "81"
-  environment:
-    WEB_PORTS: 81
-    VIRTUAL_HOST: web.nginx-proxy.tld
+version: "2"
 
-sut:
-  image: nginxproxy/nginx-proxy:test
-  volumes:
-    - /var/run/docker.sock:/tmp/docker.sock:ro
+services:
+  web:
+    image: web
+    expose:
+      - "81"
+    environment:
+      WEB_PORTS: 81
+      VIRTUAL_HOST: web.nginx-proxy.tld
+
+  sut:
+    image: nginxproxy/nginx-proxy:test
+    volumes:
+      - /var/run/docker.sock:/tmp/docker.sock:ro

+ 15 - 12
test/test_server-down/test_server-down.yml

@@ -1,13 +1,16 @@
-web:
-  image: web
-  expose:
-    - "81"
-  environment:
-    WEB_PORTS: 81
-    VIRTUAL_HOST: web.nginx-proxy.tld
-  net: "none"
+version: "2"
 
-sut:
-  image: nginxproxy/nginx-proxy:test
-  volumes:
-    - /var/run/docker.sock:/tmp/docker.sock:ro
+services:
+  web:
+    image: web
+    expose:
+      - "81"
+    environment:
+      WEB_PORTS: 81
+      VIRTUAL_HOST: web.nginx-proxy.tld
+    net: "none"
+
+  sut:
+    image: nginxproxy/nginx-proxy:test
+    volumes:
+      - /var/run/docker.sock:/tmp/docker.sock:ro

+ 67 - 65
test/test_ssl/test_dhparam.yml

@@ -1,73 +1,75 @@
-web5:
-  image: web
-  expose:
-    - "85"
-  environment:
-    WEB_PORTS: "85"
-    VIRTUAL_HOST: "web5.nginx-proxy.tld"
+version: "2"
 
-# Intended for testing with `dh-file` container.
-# VIRTUAL_HOST is paired with site-specific DH param file.
-# DEFAULT_HOST is required to avoid defaulting to web2,
-# if not specifying FQDN (`-servername`) in openssl queries.
-web2:
-  image: web
-  expose:
-    - "85"
-  environment:
-    WEB_PORTS: "85"
-    VIRTUAL_HOST: "web2.nginx-proxy.tld"
+services:
+  web5:
+    image: web
+    expose:
+      - "85"
+    environment:
+      WEB_PORTS: "85"
+      VIRTUAL_HOST: "web5.nginx-proxy.tld"
 
+  # Intended for testing with `dh-file` container.
+  # VIRTUAL_HOST is paired with site-specific DH param file.
+  # DEFAULT_HOST is required to avoid defaulting to web2,
+  # if not specifying FQDN (`-servername`) in openssl queries.
+  web2:
+    image: web
+    expose:
+      - "85"
+    environment:
+      WEB_PORTS: "85"
+      VIRTUAL_HOST: "web2.nginx-proxy.tld"
 
-# sut - System Under Test
-# `docker.sock` required for functionality
-# `certs` required to enable HTTPS via template
-with_default_group:
-  container_name: dh-default
-  image: &img-nginxproxy nginxproxy/nginx-proxy:test
-  environment: &env-common
-    - &default-host DEFAULT_HOST=web5.nginx-proxy.tld
-  volumes: &vols-common
-    - &docker-sock /var/run/docker.sock:/tmp/docker.sock:ro
-    - &nginx-certs ./certs:/etc/nginx/certs:ro
+  # sut - System Under Test
+  # `docker.sock` required for functionality
+  # `certs` required to enable HTTPS via template
+  with_default_group:
+    container_name: dh-default
+    image: &img-nginxproxy nginxproxy/nginx-proxy:test
+    environment: &env-common
+      - &default-host DEFAULT_HOST=web5.nginx-proxy.tld
+    volumes: &vols-common
+      - &docker-sock /var/run/docker.sock:/tmp/docker.sock:ro
+      - &nginx-certs ./certs:/etc/nginx/certs:ro
 
-with_alternative_group:
-  container_name: dh-env
-  environment:
-    - DHPARAM_BITS=3072
-    - *default-host
-  image: *img-nginxproxy
-  volumes: *vols-common
+  with_alternative_group:
+    container_name: dh-env
+    environment:
+      - DHPARAM_BITS=3072
+      - *default-host
+    image: *img-nginxproxy
+    volumes: *vols-common
 
-with_invalid_group:
-  container_name: invalid-group-1024
-  environment:
-    - DHPARAM_BITS=1024
-    - *default-host
-  image: *img-nginxproxy
-  volumes: *vols-common
+  with_invalid_group:
+    container_name: invalid-group-1024
+    environment:
+      - DHPARAM_BITS=1024
+      - *default-host
+    image: *img-nginxproxy
+    volumes: *vols-common
 
-with_custom_file:
-  container_name: dh-file
-  image: *img-nginxproxy
-  environment: *env-common
-  volumes:
-    - *docker-sock
-    - *nginx-certs
-    - ../../app/dhparam/ffdhe3072.pem:/etc/nginx/dhparam/dhparam.pem:ro
+  with_custom_file:
+    container_name: dh-file
+    image: *img-nginxproxy
+    environment: *env-common
+    volumes:
+      - *docker-sock
+      - *nginx-certs
+      - ../../app/dhparam/ffdhe3072.pem:/etc/nginx/dhparam/dhparam.pem:ro
 
-with_skip:
-  container_name: dh-skip
-  environment:
-    - DHPARAM_SKIP=true
-    - *default-host
-  image: *img-nginxproxy
-  volumes: *vols-common
+  with_skip:
+    container_name: dh-skip
+    environment:
+      - DHPARAM_SKIP=true
+      - *default-host
+    image: *img-nginxproxy
+    volumes: *vols-common
 
-with_skip_backward:
-  container_name: dh-skip-backward
-  environment:
-    - DHPARAM_GENERATION=false
-    - *default-host
-  image: *img-nginxproxy
-  volumes: *vols-common
+  with_skip_backward:
+    container_name: dh-skip-backward
+    environment:
+      - DHPARAM_GENERATION=false
+      - *default-host
+    image: *img-nginxproxy
+    volumes: *vols-common

+ 49 - 46
test/test_ssl/test_hsts.yml

@@ -1,51 +1,54 @@
-web1:
-  image: web
-  expose:
-    - "81"
-  environment:
-    WEB_PORTS: "81"
-    VIRTUAL_HOST: "web1.nginx-proxy.tld"
+version: "2"
 
-web2:
-  image: web
-  expose:
-    - "81"
-  environment:
-    WEB_PORTS: "81"
-    VIRTUAL_HOST: "web2.nginx-proxy.tld"
-    HSTS: "off"
+services:
+  web1:
+    image: web
+    expose:
+      - "81"
+    environment:
+      WEB_PORTS: "81"
+      VIRTUAL_HOST: "web1.nginx-proxy.tld"
 
-web3:
-  image: web
-  expose:
-    - "81"
-  environment:
-    WEB_PORTS: "81"
-    VIRTUAL_HOST: "web3.nginx-proxy.tld"
-    HSTS: "max-age=86400; includeSubDomains; preload"
+  web2:
+    image: web
+    expose:
+      - "81"
+    environment:
+      WEB_PORTS: "81"
+      VIRTUAL_HOST: "web2.nginx-proxy.tld"
+      HSTS: "off"
 
-web4:
-  image: web
-  expose:
-    - "81"
-  environment:
-    WEB_PORTS: "81"
-    VIRTUAL_HOST: "web4.nginx-proxy.tld"
-    HSTS: "off"
-    HTTPS_METHOD: "noredirect"
+  web3:
+    image: web
+    expose:
+      - "81"
+    environment:
+      WEB_PORTS: "81"
+      VIRTUAL_HOST: "web3.nginx-proxy.tld"
+      HSTS: "max-age=86400; includeSubDomains; preload"
 
-web5:
-  image: web
-  expose:
-    - "81"
-  environment:
-    WEB_PORTS: "81"
-    VIRTUAL_HOST: http3-vhost-enabled.nginx-proxy.tld
-  labels:
-    com.github.nginx-proxy.nginx-proxy.http3.enable: "true"
+  web4:
+    image: web
+    expose:
+      - "81"
+    environment:
+      WEB_PORTS: "81"
+      VIRTUAL_HOST: "web4.nginx-proxy.tld"
+      HSTS: "off"
+      HTTPS_METHOD: "noredirect"
 
-sut:
-  image: nginxproxy/nginx-proxy:test
-  volumes:
-    - /var/run/docker.sock:/tmp/docker.sock:ro
-    - ./certs:/etc/nginx/certs:ro
+  web5:
+    image: web
+    expose:
+      - "81"
+    environment:
+      WEB_PORTS: "81"
+      VIRTUAL_HOST: http3-vhost-enabled.nginx-proxy.tld
+    labels:
+      com.github.nginx-proxy.nginx-proxy.http3.enable: "true"
+
+  sut:
+    image: nginxproxy/nginx-proxy:test
+    volumes:
+      - /var/run/docker.sock:/tmp/docker.sock:ro
+      - ./certs:/etc/nginx/certs:ro

+ 18 - 15
test/test_ssl/test_https_port.yml

@@ -1,16 +1,19 @@
-web1:
-  image: web
-  expose:
-    - "81"
-  environment:
-    WEB_PORTS: "81"
-    VIRTUAL_HOST: "*.nginx-proxy.tld"
+version: "2"
 
-sut:
-  image: nginxproxy/nginx-proxy:test
-  volumes:
-    - /var/run/docker.sock:/tmp/docker.sock:ro
-    - ./certs:/etc/nginx/certs:ro
-  environment:
-    HTTP_PORT: 8080
-    HTTPS_PORT: 8443
+services:
+  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
+      - ./certs:/etc/nginx/certs:ro
+    environment:
+      HTTP_PORT: 8080
+      HTTPS_PORT: 8443

+ 15 - 13
test/test_ssl/test_nohttp.yml

@@ -1,15 +1,17 @@
-web2:
-  image: web
-  expose:
-    - "82"
-  environment:
-    WEB_PORTS: "82"
-    VIRTUAL_HOST: "web2.nginx-proxy.tld"
-    HTTPS_METHOD: nohttp
+version: "2"
 
+services:
+  web2:
+    image: web
+    expose:
+      - "82"
+    environment:
+      WEB_PORTS: "82"
+      VIRTUAL_HOST: "web2.nginx-proxy.tld"
+      HTTPS_METHOD: nohttp
 
-sut:
-  image: nginxproxy/nginx-proxy:test
-  volumes:
-    - /var/run/docker.sock:/tmp/docker.sock:ro
-    - ./certs:/etc/nginx/certs:ro
+  sut:
+    image: nginxproxy/nginx-proxy:test
+    volumes:
+      - /var/run/docker.sock:/tmp/docker.sock:ro
+      - ./certs:/etc/nginx/certs:ro

+ 14 - 12
test/test_ssl/test_nohttps.yml

@@ -1,14 +1,16 @@
-web:
-  image: web
-  expose:
-    - "83"
-  environment:
-    WEB_PORTS: "83"
-    VIRTUAL_HOST: "web.nginx-proxy.tld"
-    HTTPS_METHOD: nohttps
+version: "2"
 
+services:
+  web:
+    image: web
+    expose:
+      - "83"
+    environment:
+      WEB_PORTS: "83"
+      VIRTUAL_HOST: "web.nginx-proxy.tld"
+      HTTPS_METHOD: nohttps
 
-sut:
-  image: nginxproxy/nginx-proxy:test
-  volumes:
-    - /var/run/docker.sock:/tmp/docker.sock:ro
+  sut:
+    image: nginxproxy/nginx-proxy:test
+    volumes:
+      - /var/run/docker.sock:/tmp/docker.sock:ro

+ 15 - 13
test/test_ssl/test_noredirect.yml

@@ -1,15 +1,17 @@
-web3:
-  image: web
-  expose:
-    - "83"
-  environment:
-    WEB_PORTS: "83"
-    VIRTUAL_HOST: "web3.nginx-proxy.tld"
-    HTTPS_METHOD: noredirect
+version: "2"
 
+services:
+  web3:
+    image: web
+    expose:
+      - "83"
+    environment:
+      WEB_PORTS: "83"
+      VIRTUAL_HOST: "web3.nginx-proxy.tld"
+      HTTPS_METHOD: noredirect
 
-sut:
-  image: nginxproxy/nginx-proxy:test
-  volumes:
-    - /var/run/docker.sock:/tmp/docker.sock:ro
-    - ./certs:/etc/nginx/certs:ro
+  sut:
+    image: nginxproxy/nginx-proxy:test
+    volumes:
+      - /var/run/docker.sock:/tmp/docker.sock:ro
+      - ./certs:/etc/nginx/certs:ro

+ 25 - 23
test/test_ssl/test_virtual_path.yml

@@ -1,26 +1,28 @@
-web1:
-  image: web
-  expose:
-    - "81"
-  environment:
-    WEB_PORTS: "81"
-    VIRTUAL_HOST: "www.nginx-proxy.tld"
-    VIRTUAL_PATH: "/web1/"
-    VIRTUAL_DEST: "/"
+version: "2"
 
-web2:
-  image: web
-  expose:
-    - "82"
-  environment:
-    WEB_PORTS: "82"
-    VIRTUAL_HOST: "www.nginx-proxy.tld"
-    VIRTUAL_PATH: "/web2/"
-    VIRTUAL_DEST: "/"
+services:
+  web1:
+    image: web
+    expose:
+      - "81"
+    environment:
+      WEB_PORTS: "81"
+      VIRTUAL_HOST: "www.nginx-proxy.tld"
+      VIRTUAL_PATH: "/web1/"
+      VIRTUAL_DEST: "/"
 
-sut:
-  image: nginxproxy/nginx-proxy:test
-  volumes:
-    - /var/run/docker.sock:/tmp/docker.sock:ro
-    - ./certs:/etc/nginx/certs:ro
+  web2:
+    image: web
+    expose:
+      - "82"
+    environment:
+      WEB_PORTS: "82"
+      VIRTUAL_HOST: "www.nginx-proxy.tld"
+      VIRTUAL_PATH: "/web2/"
+      VIRTUAL_DEST: "/"
 
+  sut:
+    image: nginxproxy/nginx-proxy:test
+    volumes:
+      - /var/run/docker.sock:/tmp/docker.sock:ro
+      - ./certs:/etc/nginx/certs:ro

+ 15 - 12
test/test_ssl/test_wildcard.yml

@@ -1,13 +1,16 @@
-web1:
-  image: web
-  expose:
-    - "81"
-  environment:
-    WEB_PORTS: "81"
-    VIRTUAL_HOST: "*.nginx-proxy.tld"
+version: "2"
 
-sut:
-  image: nginxproxy/nginx-proxy:test
-  volumes:
-    - /var/run/docker.sock:/tmp/docker.sock:ro
-    - ./certs:/etc/nginx/certs:ro
+services:
+  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
+      - ./certs:/etc/nginx/certs:ro

+ 16 - 14
test/test_trust-downstream-proxy/test_default.yml

@@ -1,16 +1,18 @@
-web:
-  image: web
-  expose:
-    - "80"
-  environment:
-    WEB_PORTS: 80
-    VIRTUAL_HOST: web.nginx-proxy.tld
-    HTTPS_METHOD: noredirect
+version: "2"
 
+services:
+  web:
+    image: web
+    expose:
+      - "80"
+    environment:
+      WEB_PORTS: 80
+      VIRTUAL_HOST: web.nginx-proxy.tld
+      HTTPS_METHOD: noredirect
 
-sut:
-  image: nginxproxy/nginx-proxy:test
-  volumes:
-    - /var/run/docker.sock:/tmp/docker.sock:ro
-    - ./certs/web.nginx-proxy.tld.crt:/etc/nginx/certs/web.nginx-proxy.tld.crt:ro
-    - ./certs/web.nginx-proxy.tld.key:/etc/nginx/certs/web.nginx-proxy.tld.key:ro
+  sut:
+    image: nginxproxy/nginx-proxy:test
+    volumes:
+      - /var/run/docker.sock:/tmp/docker.sock:ro
+      - ./certs/web.nginx-proxy.tld.crt:/etc/nginx/certs/web.nginx-proxy.tld.crt:ro
+      - ./certs/web.nginx-proxy.tld.key:/etc/nginx/certs/web.nginx-proxy.tld.key:ro

+ 18 - 16
test/test_trust-downstream-proxy/test_disabled.yml

@@ -1,18 +1,20 @@
-web:
-  image: web
-  expose:
-    - "80"
-  environment:
-    WEB_PORTS: 80
-    VIRTUAL_HOST: web.nginx-proxy.tld
-    HTTPS_METHOD: noredirect
+version: "2"
 
+services:
+  web:
+    image: web
+    expose:
+      - "80"
+    environment:
+      WEB_PORTS: 80
+      VIRTUAL_HOST: web.nginx-proxy.tld
+      HTTPS_METHOD: noredirect
 
-sut:
-  image: nginxproxy/nginx-proxy:test
-  environment:
-    TRUST_DOWNSTREAM_PROXY: "false"
-  volumes:
-    - /var/run/docker.sock:/tmp/docker.sock:ro
-    - ./certs/web.nginx-proxy.tld.crt:/etc/nginx/certs/web.nginx-proxy.tld.crt:ro
-    - ./certs/web.nginx-proxy.tld.key:/etc/nginx/certs/web.nginx-proxy.tld.key:ro
+  sut:
+    image: nginxproxy/nginx-proxy:test
+    environment:
+      TRUST_DOWNSTREAM_PROXY: "false"
+    volumes:
+      - /var/run/docker.sock:/tmp/docker.sock:ro
+      - ./certs/web.nginx-proxy.tld.crt:/etc/nginx/certs/web.nginx-proxy.tld.crt:ro
+      - ./certs/web.nginx-proxy.tld.key:/etc/nginx/certs/web.nginx-proxy.tld.key:ro

+ 18 - 16
test/test_trust-downstream-proxy/test_enabled.yml

@@ -1,18 +1,20 @@
-web:
-  image: web
-  expose:
-    - "80"
-  environment:
-    WEB_PORTS: 80
-    VIRTUAL_HOST: web.nginx-proxy.tld
-    HTTPS_METHOD: noredirect
+version: "2"
 
+services:
+  web:
+    image: web
+    expose:
+      - "80"
+    environment:
+      WEB_PORTS: 80
+      VIRTUAL_HOST: web.nginx-proxy.tld
+      HTTPS_METHOD: noredirect
 
-sut:
-  image: nginxproxy/nginx-proxy:test
-  environment:
-    TRUST_DOWNSTREAM_PROXY: "true"
-  volumes:
-    - /var/run/docker.sock:/tmp/docker.sock:ro
-    - ./certs/web.nginx-proxy.tld.crt:/etc/nginx/certs/web.nginx-proxy.tld.crt:ro
-    - ./certs/web.nginx-proxy.tld.key:/etc/nginx/certs/web.nginx-proxy.tld.key:ro
+  sut:
+    image: nginxproxy/nginx-proxy:test
+    environment:
+      TRUST_DOWNSTREAM_PROXY: "true"
+    volumes:
+      - /var/run/docker.sock:/tmp/docker.sock:ro
+      - ./certs/web.nginx-proxy.tld.crt:/etc/nginx/certs/web.nginx-proxy.tld.crt:ro
+      - ./certs/web.nginx-proxy.tld.key:/etc/nginx/certs/web.nginx-proxy.tld.key:ro

+ 1 - 1
test/test_upstream-name/test_predictable-name.yml

@@ -1,4 +1,4 @@
-version: '2'
+version: "2"
 
 services:
   web:

+ 1 - 1
test/test_upstream-name/test_sha1-name.yml

@@ -1,4 +1,4 @@
-version: '2'
+version: "2"
 
 services:
   web:

+ 6 - 0
test/test_vhost-empty-string.yml

@@ -1,8 +1,11 @@
+version: "2"
+
 services:
   sut:
     image: nginxproxy/nginx-proxy:test
     volumes:
       - /var/run/docker.sock:/tmp/docker.sock:ro
+
   web1:
     image: web
     expose:
@@ -11,6 +14,7 @@ services:
       WEB_PORTS: "81"
       # The space is intentional (should be trimmed).
       VIRTUAL_HOST: " "
+
   web2:
     image: web
     expose:
@@ -19,6 +23,7 @@ services:
       WEB_PORTS: "82"
       # The space is intentional (should be trimmed).
       VIRTUAL_HOST: "web2.nginx-proxy.test ,"
+
   web3:
     image: web
     expose:
@@ -27,6 +32,7 @@ services:
       WEB_PORTS: "83"
       # The space is intentional (should be trimmed).
       VIRTUAL_HOST: " ,web3.nginx-proxy.test"
+
   web4:
     image: web
     expose:

+ 1 - 1
test/test_vhost-in-multiple-networks.yml

@@ -1,4 +1,4 @@
-version: '2'
+version: "2"
 
 networks:
   net1: {}

+ 44 - 43
test/test_virtual-path/test_custom_conf.yml

@@ -1,48 +1,49 @@
+version: "2"
 
-foo:
-  image: web
-  expose:
-    - "42"
-  environment:
-    WEB_PORTS: "42"
-    VIRTUAL_HOST: "foo.nginx-proxy.test"
+services:
+  foo:
+    image: web
+    expose:
+      - "42"
+    environment:
+      WEB_PORTS: "42"
+      VIRTUAL_HOST: "foo.nginx-proxy.test"
 
-web1:
-  image: web
-  expose:
-    - "81"
-  environment:
-    WEB_PORTS: "81"
-    VIRTUAL_HOST: "nginx-proxy.test"
-    VIRTUAL_PATH: "/web1/"
-    VIRTUAL_DEST: "/"
+  web1:
+    image: web
+    expose:
+      - "81"
+    environment:
+      WEB_PORTS: "81"
+      VIRTUAL_HOST: "nginx-proxy.test"
+      VIRTUAL_PATH: "/web1/"
+      VIRTUAL_DEST: "/"
 
-web2:
-  image: web
-  expose:
-    - "82"
-  environment:
-    WEB_PORTS: "82"
-    VIRTUAL_HOST: "nginx-proxy.test"
-    VIRTUAL_PATH: "/web2/"
-    VIRTUAL_DEST: "/"
+  web2:
+    image: web
+    expose:
+      - "82"
+    environment:
+      WEB_PORTS: "82"
+      VIRTUAL_HOST: "nginx-proxy.test"
+      VIRTUAL_PATH: "/web2/"
+      VIRTUAL_DEST: "/"
 
-web3:
-  image: web
-  expose:
-    - "83"
-  environment:
-    WEB_PORTS: "83"
-    VIRTUAL_HOST: "nginx-proxy.test"
-    VIRTUAL_PATH: "~ ^/(web3|alt)/"
-
-sut:
-  image: nginxproxy/nginx-proxy:test
-  environment:
-    DEFAULT_ROOT: 418
-  volumes:
-    - /var/run/docker.sock:/tmp/docker.sock:ro
-    - ./foo.conf:/etc/nginx/vhost.d/foo.nginx-proxy.test:ro
-    - ./bar.conf:/etc/nginx/vhost.d/nginx-proxy.test_918d687a929083edd0c7224ee2293e0e7c062ab4_location:ro
-    - ./alternate.conf:/etc/nginx/vhost.d/nginx-proxy.test_7fb22b74bbdf907425dbbad18e4462565cada230_location:ro
+  web3:
+    image: web
+    expose:
+      - "83"
+    environment:
+      WEB_PORTS: "83"
+      VIRTUAL_HOST: "nginx-proxy.test"
+      VIRTUAL_PATH: "~ ^/(web3|alt)/"
 
+  sut:
+    image: nginxproxy/nginx-proxy:test
+    environment:
+      DEFAULT_ROOT: 418
+    volumes:
+      - /var/run/docker.sock:/tmp/docker.sock:ro
+      - ./foo.conf:/etc/nginx/vhost.d/foo.nginx-proxy.test:ro
+      - ./bar.conf:/etc/nginx/vhost.d/nginx-proxy.test_918d687a929083edd0c7224ee2293e0e7c062ab4_location:ro
+      - ./alternate.conf:/etc/nginx/vhost.d/nginx-proxy.test_7fb22b74bbdf907425dbbad18e4462565cada230_location:ro

+ 19 - 16
test/test_virtual-path/test_forwarding.yml

@@ -1,17 +1,20 @@
-web1:
-  image: web
-  expose:
-    - "81"
-  environment:
-    WEB_PORTS: "81"
-    VIRTUAL_HOST: "www.nginx-proxy.tld"
-    VIRTUAL_PATH: "/web1/"
-    VIRTUAL_DEST: "/"
+version: "2"
 
-sut:
-  image: nginxproxy/nginx-proxy:test
-  volumes:
-    - /var/run/docker.sock:/tmp/docker.sock:ro
-    - ./certs:/etc/nginx/certs:ro
-  environment:
-    - DEFAULT_ROOT=301 http://$$host/web1$$request_uri
+services:
+  web1:
+    image: web
+    expose:
+      - "81"
+    environment:
+      WEB_PORTS: "81"
+      VIRTUAL_HOST: "www.nginx-proxy.tld"
+      VIRTUAL_PATH: "/web1/"
+      VIRTUAL_DEST: "/"
+
+  sut:
+    image: nginxproxy/nginx-proxy:test
+    volumes:
+      - /var/run/docker.sock:/tmp/docker.sock:ro
+      - ./certs:/etc/nginx/certs:ro
+    environment:
+      - DEFAULT_ROOT=301 http://$$host/web1$$request_uri

+ 37 - 34
test/test_virtual-path/test_location_precedence.yml

@@ -1,37 +1,40 @@
-web1:
-  image: web
-  expose:
-    - "81"
-  environment:
-    WEB_PORTS: "81"
-    VIRTUAL_HOST: "foo.nginx-proxy.test"
-    VIRTUAL_PATH: "/web1/"
-    VIRTUAL_DEST: "/"
+version: "2"
 
-web2:
-  image: web
-  expose:
-    - "82"
-  environment:
-    WEB_PORTS: "82"
-    VIRTUAL_HOST: "bar.nginx-proxy.test"
-    VIRTUAL_PATH: "/web2/"
-    VIRTUAL_DEST: "/"
+services:
+  web1:
+    image: web
+    expose:
+      - "81"
+    environment:
+      WEB_PORTS: "81"
+      VIRTUAL_HOST: "foo.nginx-proxy.test"
+      VIRTUAL_PATH: "/web1/"
+      VIRTUAL_DEST: "/"
 
-web3:
-  image: web
-  expose:
-    - "83"
-  environment:
-    WEB_PORTS: "83"
-    VIRTUAL_HOST: "bar.nginx-proxy.test"
-    VIRTUAL_PATH: "/web3/"
-    VIRTUAL_DEST: "/"
+  web2:
+    image: web
+    expose:
+      - "82"
+    environment:
+      WEB_PORTS: "82"
+      VIRTUAL_HOST: "bar.nginx-proxy.test"
+      VIRTUAL_PATH: "/web2/"
+      VIRTUAL_DEST: "/"
 
-sut:
-  image: nginxproxy/nginx-proxy:test
-  volumes:
-    - /var/run/docker.sock:/tmp/docker.sock:ro
-    - ./default.conf:/etc/nginx/vhost.d/default_location:ro
-    - ./host.conf:/etc/nginx/vhost.d/bar.nginx-proxy.test_location:ro
-    - ./path.conf:/etc/nginx/vhost.d/bar.nginx-proxy.test_99f2db0ed8aa95dbb5b87fca79c7eff2ff6bb8bd_location:ro
+  web3:
+    image: web
+    expose:
+      - "83"
+    environment:
+      WEB_PORTS: "83"
+      VIRTUAL_HOST: "bar.nginx-proxy.test"
+      VIRTUAL_PATH: "/web3/"
+      VIRTUAL_DEST: "/"
+
+  sut:
+    image: nginxproxy/nginx-proxy:test
+    volumes:
+      - /var/run/docker.sock:/tmp/docker.sock:ro
+      - ./default.conf:/etc/nginx/vhost.d/default_location:ro
+      - ./host.conf:/etc/nginx/vhost.d/bar.nginx-proxy.test_location:ro
+      - ./path.conf:/etc/nginx/vhost.d/bar.nginx-proxy.test_99f2db0ed8aa95dbb5b87fca79c7eff2ff6bb8bd_location:ro

+ 39 - 37
test/test_virtual-path/test_virtual_paths.yml

@@ -1,42 +1,44 @@
+version: "2"
 
-foo:
-  image: web
-  expose:
-    - "42"
-  environment:
-    WEB_PORTS: "42"
-    VIRTUAL_HOST: "foo.nginx-proxy.test"
+services:
+  foo:
+    image: web
+    expose:
+      - "42"
+    environment:
+      WEB_PORTS: "42"
+      VIRTUAL_HOST: "foo.nginx-proxy.test"
 
-web1:
-  image: web
-  expose:
-    - "81"
-  environment:
-    WEB_PORTS: "81"
-    VIRTUAL_HOST: "nginx-proxy.test"
-    VIRTUAL_PATH: "/web1/"
-    VIRTUAL_DEST: "/"
+  web1:
+    image: web
+    expose:
+      - "81"
+    environment:
+      WEB_PORTS: "81"
+      VIRTUAL_HOST: "nginx-proxy.test"
+      VIRTUAL_PATH: "/web1/"
+      VIRTUAL_DEST: "/"
 
-web2:
-  image: web
-  expose:
-    - "82"
-  environment:
-    WEB_PORTS: "82"
-    VIRTUAL_HOST: "nginx-proxy.test"
-    VIRTUAL_PATH: "/web2/"
-    VIRTUAL_DEST: "/"
+  web2:
+    image: web
+    expose:
+      - "82"
+    environment:
+      WEB_PORTS: "82"
+      VIRTUAL_HOST: "nginx-proxy.test"
+      VIRTUAL_PATH: "/web2/"
+      VIRTUAL_DEST: "/"
 
-web3:
-  image: web
-  expose:
-    - "83"
-  environment:
-    WEB_PORTS: "83"
-    VIRTUAL_HOST: "nginx-proxy.test"
-    VIRTUAL_PATH: "/"
+  web3:
+    image: web
+    expose:
+      - "83"
+    environment:
+      WEB_PORTS: "83"
+      VIRTUAL_HOST: "nginx-proxy.test"
+      VIRTUAL_PATH: "/"
 
-sut:
-  image: nginxproxy/nginx-proxy:test
-  volumes:
-    - /var/run/docker.sock:/tmp/docker.sock:ro
+  sut:
+    image: nginxproxy/nginx-proxy:test
+    volumes:
+      - /var/run/docker.sock:/tmp/docker.sock:ro

+ 34 - 32
test/test_wildcard_host.yml

@@ -1,37 +1,39 @@
-web1:
-  image: web
-  expose:
-    - "81"
-  environment:
-    WEB_PORTS: "81"
-    VIRTUAL_HOST: "*.nginx-proxy.test"
+version: "2"
 
-web2:
-  image: web
-  expose:
-    - "82"
-  environment:
-    WEB_PORTS: "82"
-    VIRTUAL_HOST: "test.nginx-proxy.*"
+services:
+  web1:
+    image: web
+    expose:
+      - "81"
+    environment:
+      WEB_PORTS: "81"
+      VIRTUAL_HOST: "*.nginx-proxy.test"
 
-web3:
-  image: web
-  expose:
-    - "83"
-  environment:
-    WEB_PORTS: "83"
-    VIRTUAL_HOST: ~^web3\..*\.nginx-proxy\.regexp
+  web2:
+    image: web
+    expose:
+      - "82"
+    environment:
+      WEB_PORTS: "82"
+      VIRTUAL_HOST: "test.nginx-proxy.*"
 
-web4:
-  image: web
-  expose:
-    - "84"
-  environment:
-    WEB_PORTS: "84"
-    VIRTUAL_HOST: ~^web4\..*\.nginx-proxy\.regexp$$ # we need to double the `$` because of docker compose variable interpolation
+  web3:
+    image: web
+    expose:
+      - "83"
+    environment:
+      WEB_PORTS: "83"
+      VIRTUAL_HOST: ~^web3\..*\.nginx-proxy\.regexp
 
+  web4:
+    image: web
+    expose:
+      - "84"
+    environment:
+      WEB_PORTS: "84"
+      VIRTUAL_HOST: ~^web4\..*\.nginx-proxy\.regexp$$ # we need to double the `$` because of docker compose variable interpolation
 
-sut:
-  image: nginxproxy/nginx-proxy:test
-  volumes:
-    - /var/run/docker.sock:/tmp/docker.sock:ro
+  sut:
+    image: nginxproxy/nginx-proxy:test
+    volumes:
+      - /var/run/docker.sock:/tmp/docker.sock:ro