[master] 0244e1cb2 fix/polish .port VCL backend attribute documentation

Nils Goroll nils.goroll at uplex.de
Tue May 24 10:56:08 UTC 2022


commit 0244e1cb2f60bc6253f5b689e3b7177ab25b2592
Author: Nils Goroll <nils.goroll at uplex.de>
Date:   Tue May 24 12:32:29 2022 +0200

    fix/polish .port VCL backend attribute documentation

diff --git a/bin/varnishtest/tests/b00058.vtc b/bin/varnishtest/tests/b00058.vtc
new file mode 100644
index 000000000..c794fa6e9
--- /dev/null
+++ b/bin/varnishtest/tests/b00058.vtc
@@ -0,0 +1,12 @@
+varnishtest "Test backend definition documentation examples"
+
+feature cmd {getent hosts localhost && getent services http}
+
+varnish v1 -arg "-p vcc_err_unref=off" -vcl {
+	backend b1 {.host = "127.0.0.1";}
+	backend b2 {.host = "[::1]:8080";}
+	backend b3 {.host = "localhost:8081";}
+	backend b4 {.host = "localhost:http";}
+	backend b5 {.host = "127.0.0.1";.port = "8081";}
+	backend b6 {.host = "127.0.0.1";.port = "http";}
+}
\ No newline at end of file
diff --git a/doc/sphinx/reference/vcl-backend.rst b/doc/sphinx/reference/vcl-backend.rst
index 148172295..a1f66e9f7 100644
--- a/doc/sphinx/reference/vcl-backend.rst
+++ b/doc/sphinx/reference/vcl-backend.rst
@@ -57,10 +57,17 @@ one IPv4 and one IPv6 address::
 
     .host = "example.com:8081";
 
-The TCP port number can be specified as part of ``.host`` as above
-or separately using the ``.port`` attribute::
+    .host = "example.com:http";
 
-    .port = 8081;
+Attribute ``.port``
+-------------------
+
+The TCP port number or service name can be specified as part of
+``.host`` as above or separately using the ``.port`` attribute::
+
+    .port = "8081";
+
+    .port = "http";
 
 Attribute ``.path``
 -------------------


More information about the varnish-commit mailing list