 doc/configuration.txt | 13 ++++++++++++-
 include/types/proxy.h |  2 ++
 src/cfgparse-listen.c | 26 ++++++++++++++++++++++++++
 src/checks.c          | 11 +++++++++++
 4 files changed, 51 insertions(+), 1 deletion(-)

diff --git a/doc/configuration.txt b/doc/configuration.txt
index d8e1b57f1..d42934ef5 100644
--- a/doc/configuration.txt
+++ b/doc/configuration.txt
@@ -2436,10 +2436,11 @@ hash-type                                 X          -         X         X
 http-check disable-on-404                 X          -         X         X
 http-check expect                         -          -         X         X
 http-check send-state                     X          -         X         X
+http-check send-name-header               X          -         X         X
 http-request                              -          X         X         X
 http-response                             -          X         X         X
 http-reuse                                X          -         X         X
-http-send-name-header                     -          -         X         X
+http-send-name-header                     X          -         X         X
 id                                        -          X         X         X
 ignore-persist                            -          -         X         X
 load-server-state-from-file               X          -         X         X
@@ -4142,6 +4143,16 @@ http-check send-state
   See also : "option httpchk", "http-check disable-on-404"
 
 
+http-check send-name-header [<header>]
+  Add the server name to a request. Use the header string given by <header>
+  May be used in sections:   defaults | frontend | listen | backend
+                               yes    |    no    |   yes  |   yes
+  Arguments :
+    <header>  The header string to use to send the server name
+
+  See also : "option httpchk", "http-send-name-header"
+
+
 http-request <action> [options...] [ { if | unless } <condition> ]
   Access control for Layer 7 requests
 
diff --git a/include/types/proxy.h b/include/types/proxy.h
index 6ea96b3ad..570b6e93d 100644
--- a/include/types/proxy.h
+++ b/include/types/proxy.h
@@ -386,6 +386,8 @@ struct proxy {
 	int orgto_hdr_len;			/* length of "x-original-to" header */
 	char *server_id_hdr_name;                   /* the header to use to send the server id (name) */
 	int server_id_hdr_len;                      /* the length of the id (name) header... name */
+	char *http_check_send_hdr_name;             /* the healthcheck header to use to send the server id (name) */
+	int http_check_send_hdr_len;                /* the length of the healthcheck (name) header... name */
 	int conn_retries;			/* maximum number of connect retries */
 	unsigned int retry_type;                /* Type of retry allowed */
 	int redispatch_after;			/* number of retries before redispatch */
diff --git a/src/cfgparse-listen.c b/src/cfgparse-listen.c
index 09b172724..4803b7b77 100644
--- a/src/cfgparse-listen.c
+++ b/src/cfgparse-listen.c
@@ -261,6 +261,11 @@ int cfg_parse_listen(const char *file, int linenum, char **args, int kwm)
 			curproxy->server_id_hdr_name = strdup(defproxy.server_id_hdr_name);
 		}
 
+		if (defproxy.http_check_send_hdr_len) {
+			curproxy->http_check_send_hdr_len  = defproxy.http_check_send_hdr_len;
+			curproxy->http_check_send_hdr_name = strdup(defproxy.http_check_send_hdr_name);
+		}
+
 		/* initialize error relocations */
 		for (rc = 0; rc < HTTP_ERR_SIZE; rc++)
 			chunk_dup(&curproxy->errmsg[rc], &defproxy.errmsg[rc]);
@@ -484,6 +489,8 @@ int cfg_parse_listen(const char *file, int linenum, char **args, int kwm)
 		defproxy.orgto_hdr_len = 0;
 		free(defproxy.server_id_hdr_name);
 		defproxy.server_id_hdr_len = 0;
+		free(defproxy.http_check_send_hdr_name);
+		defproxy.http_check_send_hdr_len = 0;
 		free(defproxy.expect_str);
 		regex_free(defproxy.expect_regex);
 		defproxy.expect_regex = NULL;
@@ -2739,6 +2746,25 @@ stats_error_parsing:
 			if (alertif_too_many_args_idx(0, 1, file, linenum, args, &err_code))
 				goto out;
 		}
+		else if (strcmp(args[1], "send-name-header") == 0) {
+			/* send server name in healthcheck header */
+			/* set the header name and length into the proxy structure */
+			if (warnifnotcap(curproxy, PR_CAP_BE, file, linenum, args[1], NULL))
+				err_code |= ERR_WARN;
+
+			if (!*args[2]) {
+				ha_alert("parsing [%s:%d] : '%s' requires a header string.\n",
+					 file, linenum, args[1]);
+				err_code |= ERR_ALERT | ERR_FATAL;
+				goto out;
+			}
+
+			/* set the desired header name, in lower case */
+			free(curproxy->http_check_send_hdr_name);
+			curproxy->http_check_send_hdr_name = strdup(args[2]);
+			curproxy->http_check_send_hdr_len  = strlen(curproxy->http_check_send_hdr_name);
+			ist2bin_lc(curproxy->http_check_send_hdr_name, ist2(curproxy->http_check_send_hdr_name, curproxy->http_check_send_hdr_len));
+		}
 		else if (strcmp(args[1], "expect") == 0) {
 			const char *ptr_arg;
 			int cur_arg;
diff --git a/src/checks.c b/src/checks.c
index 247caf12e..0b8f418ea 100644
--- a/src/checks.c
+++ b/src/checks.c
@@ -1611,12 +1611,23 @@ static int connect_conn_chk(struct task *t)
 			memcpy(b_head(&check->bo) + 11, &gmt_time, 4);
 		}
 		else if ((check->type) == PR_O2_HTTP_CHK) {
+			if (s->proxy->http_check_send_hdr_name)
+			{
+				b_putist(&check->bo, ist(s->proxy->http_check_send_hdr_name));
+				b_putist(&check->bo, ist(": "));
+				b_putist(&check->bo, ist(s->id));
+				b_putist(&check->bo, ist("\r\n"));
+			}
 			if (s->proxy->options2 & PR_O2_CHK_SNDST)
+			{
 				b_putblk(&check->bo, trash.area,
 					 httpchk_build_status_header(s, trash.area, trash.size));
+			}
 			/* prevent HTTP keep-alive when "http-check expect" is used */
 			if (s->proxy->options2 & PR_O2_EXP_TYPE)
+			{
 				b_putist(&check->bo, ist("Connection: close\r\n"));
+			}
 			b_putist(&check->bo, ist("\r\n"));
 			*b_tail(&check->bo) = '\0'; /* to make gdb output easier to read */
 		}
