41a6c3
diff --git a/modules/proxy/mod_proxy.c b/modules/proxy/mod_proxy.c
41a6c3
index b10be15..506a046 100644
41a6c3
--- a/modules/proxy/mod_proxy.c
41a6c3
+++ b/modules/proxy/mod_proxy.c
41a6c3
@@ -1320,6 +1320,7 @@ static void *create_proxy_dir_config(apr_pool_t *p, char *dummy)
41a6c3
     new->error_override = 0;
41a6c3
     new->error_override_set = 0;
41a6c3
     new->add_forwarded_headers = 1;
41a6c3
+    new->add_forwarded_headers_set = 0;
41a6c3
 
41a6c3
     return (void *) new;
41a6c3
 }
41a6c3
@@ -1350,7 +1351,12 @@ static void *merge_proxy_dir_config(apr_pool_t *p, void *basev, void *addv)
41a6c3
     new->error_override_set = add->error_override_set || base->error_override_set;
41a6c3
     new->alias = (add->alias_set == 0) ? base->alias : add->alias;
41a6c3
     new->alias_set = add->alias_set || base->alias_set;
41a6c3
-    new->add_forwarded_headers = add->add_forwarded_headers;
41a6c3
+    new->add_forwarded_headers =
41a6c3
+        (add->add_forwarded_headers_set == 0) ? base->add_forwarded_headers
41a6c3
+        : add->add_forwarded_headers;
41a6c3
+    new->add_forwarded_headers_set = add->add_forwarded_headers_set
41a6c3
+        || base->add_forwarded_headers_set;
41a6c3
+
41a6c3
     return new;
41a6c3
 }
41a6c3
 
41a6c3
@@ -1837,6 +1843,7 @@ static const char *
41a6c3
 {
41a6c3
    proxy_dir_conf *conf = dconf;
41a6c3
    conf->add_forwarded_headers = flag;
41a6c3
+   conf->add_forwarded_headers_set = 1;
41a6c3
    return NULL;
41a6c3
 }
41a6c3
 static const char *
41a6c3
diff --git a/modules/proxy/mod_proxy.h b/modules/proxy/mod_proxy.h
41a6c3
index 06f2b17..8c76d4c 100644
41a6c3
--- a/modules/proxy/mod_proxy.h
41a6c3
+++ b/modules/proxy/mod_proxy.h
41a6c3
@@ -219,6 +219,7 @@ typedef struct {
41a6c3
     unsigned int error_override_set:1;
41a6c3
     unsigned int alias_set:1;
41a6c3
     unsigned int add_forwarded_headers:1;
41a6c3
+    unsigned int add_forwarded_headers_set:1;
41a6c3
 } proxy_dir_conf;
41a6c3
 
41a6c3
 /* if we interpolate env vars per-request, we'll need a per-request