Index: nginx-1.2.6/src/core/ngx_connection.c
===================================================================
--- nginx-1.2.6.orig/src/core/ngx_connection.c
+++ nginx-1.2.6/src/core/ngx_connection.c
@@ -334,6 +334,25 @@ ngx_open_listening_sockets(ngx_cycle_t *
                 return NGX_ERROR;
             }
 
+#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 && ls[i].ipv6only) {
Index: nginx-1.2.6/src/core/ngx_connection.h
===================================================================
--- nginx-1.2.6.orig/src/core/ngx_connection.h
+++ nginx-1.2.6/src/core/ngx_connection.h
@@ -62,6 +62,9 @@ struct ngx_listening_s {
     unsigned            nonblocking:1;
     unsigned            shared:1;    /* shared between threads or processes */
     unsigned            addr_ntop:1;
+#if (NGX_HAVE_TRANSPARENT && defined IP_TRANSPARENT)
+    unsigned            transparent:1;
+#endif
 
 #if (NGX_HAVE_INET6 && defined IPV6_V6ONLY)
     unsigned            ipv6only:2;
Index: nginx-1.2.6/src/http/ngx_http.c
===================================================================
--- nginx-1.2.6.orig/src/http/ngx_http.c
+++ nginx-1.2.6/src/http/ngx_http.c
@@ -1769,6 +1769,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;
Index: nginx-1.2.6/src/http/ngx_http_core_module.c
===================================================================
--- nginx-1.2.6.orig/src/http/ngx_http_core_module.c
+++ nginx-1.2.6/src/http/ngx_http_core_module.c
@@ -3975,6 +3975,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;
Index: nginx-1.2.6/src/http/ngx_http_core_module.h
===================================================================
--- nginx-1.2.6.orig/src/http/ngx_http_core_module.h
+++ nginx-1.2.6/src/http/ngx_http_core_module.h
@@ -72,6 +72,9 @@ typedef struct {
     unsigned                   default_server:1;
     unsigned                   bind:1;
     unsigned                   wildcard:1;
+#if (NGX_HAVE_TRANSPARENT && defined IP_TRANSPARENT)
+    unsigned                   transparent:1;
+#endif
 #if (NGX_HTTP_SSL)
     unsigned                   ssl:1;
 #endif
Index: nginx-1.2.6/auto/unix
===================================================================
--- nginx-1.2.6.orig/auto/unix
+++ nginx-1.2.6/auto/unix
@@ -298,6 +298,17 @@ if [ $ngx_found != yes ]; 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
