@@ -0,0 +1,30 @@
+--- bin/varnishncsa/varnishncsa.c.orig 2008-11-07 19:30:50.000000000 +0100
++++ bin/varnishncsa/varnishncsa.c 2008-11-07 19:46:01.000000000 +0100
+@@ -103,6 +103,7 @@
+
+ static size_t nll;
+ static int prefer_x_forwarded_for = 0;
++static int print_virtualhost = 0;
+
+ static int
+ isprefix(const char *str, const char *prefix, const char *end, const char **next)
+@@ -400,6 +401,9 @@
+ fo = priv;
+
+ /* %h */
++ if (lp->df_Host && print_virtualhost)
++ fprintf(fo, "%s ", lp->df_Host);
++
+ if (!lp->df_h && spec & VSL_S_BACKEND)
+ fprintf(fo, "127.0.0.1 ");
+ else if (lp->df_X_Forwarded_For && prefer_x_forwarded_for)
+@@ -546,6 +550,9 @@
+ case 'P':
+ P_arg = optarg;
+ break;
++ case 'v':
++ print_virtualhost = 1;
++ break;
+ case 'V':
+ varnish_version("varnishncsa");
+ exit(0);
|