--- a/src/core/ngx_connection.c
+++ b/src/core/ngx_connection.c
@@ -497,6 +497,25 @@ ngx_open_listening_sockets(ngx_cycle_t *
             }
 #endif
 
+#if (NGX_HAVE_TRANSPARENT && defined IP_TRANSPARENT)
+
+	    if (ls[i].transparent) {
+	        int  transparent;
+
+		transparent = (ls[i].transparent == 1);
+
+		if (setsockopt(s, SOL_IP, IP_TRANSPARENT,
+                               (const void *) &transparent, sizeof(int))
+                    == -1)
+		{
+		    ngx_log_error(NGX_LOG_EMERG, log, ngx_socket_errno,
+                                  "setsockopt(IP_TRANSPARENT) for %V failed, "
+				  "ignored",
+                                  &ls[i].addr_text);
+		}
+	    }
+#endif
+
 #if (NGX_HAVE_INET6 && defined IPV6_V6ONLY)
 
             if (ls[i].sockaddr->sa_family == AF_INET6) {
--- a/src/core/ngx_connection.h
+++ b/src/core/ngx_connection.h
@@ -87,6 +87,10 @@ struct ngx_listening_s {
     int                 fastopen;
 #endif
 
+#if (NGX_HAVE_TRANSPARENT && defined IP_TRANSPARENT)
+    unsigned            transparent:1;
+#endif
+
 };
 
 
--- a/src/http/ngx_http.c
+++ b/src/http/ngx_http.c
@@ -1745,6 +1745,11 @@ ngx_http_add_listening(ngx_conf_t *cf, n
     ls->sndbuf = addr->opt.sndbuf;
 
     ls->keepalive = addr->opt.so_keepalive;
+
+#if (NGX_HAVE_TRANSPARENT && defined IP_TRANSPARENT)
+    ls->transparent = addr->opt.transparent;
+#endif
+
 #if (NGX_HAVE_KEEPALIVE_TUNABLE)
     ls->keepidle = addr->opt.tcp_keepidle;
     ls->keepintvl = addr->opt.tcp_keepintvl;
--- a/src/http/ngx_http_core_module.c
+++ b/src/http/ngx_http_core_module.c
@@ -4101,6 +4101,18 @@ ngx_http_core_listen(ngx_conf_t *cf, ngx
             continue;
         }
 
+	if (ngx_strcmp(value[n].data, "transparent") == 0) {
+#if (NGX_HAVE_TRANSPARENT && defined IP_TRANSPARENT)
+	    lsopt.transparent = 1;
+#else
+            ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
+	                       "transparent mode is not supported "
+			       "on this platform, ignored",
+			       &value[n]);
+#endif
+	    continue;
+	}
+
         if (ngx_strncmp(value[n].data, "ipv6only=o", 10) == 0) {
 #if (NGX_HAVE_INET6 && defined IPV6_V6ONLY)
             struct sockaddr  *sa;
--- a/src/http/ngx_http_core_module.h
+++ b/src/http/ngx_http_core_module.h
@@ -81,6 +81,9 @@ typedef struct {
     unsigned                   reuseport:1;
     unsigned                   so_keepalive:2;
     unsigned                   proxy_protocol:1;
+#if (NGX_HAVE_TRANSPARENT && defined IP_TRANSPARENT)
+    unsigned                   transparent:1;
+#endif
 
     int                        backlog;
     int                        rcvbuf;
--- a/auto/unix
+++ b/auto/unix
@@ -300,6 +300,17 @@ if [ $ngx_found = no ]; then
 fi
 
 
+ngx_feature="IP_TRANSPARENT"
+ngx_feature_name="NGX_HAVE_TRANSPARENT"
+ngx_feature_run=no
+ngx_feature_incs="#include <sys/socket.h>
+                  #include <netinet/in.h>"
+ngx_feature_path=
+ngx_feature_libs=
+ngx_feature_test="setsockopt(0, SOL_IP, IP_TRANSPARENT, NULL, 0)"
+. auto/feature
+
+
 ngx_feature="SO_SETFIB"
 ngx_feature_name="NGX_HAVE_SETFIB"
 ngx_feature_run=no
