mirror of
				https://github.com/thib8956/nginx-proxy
				synced 2025-11-04 02:59:20 +00:00 
			
		
		
		
	refactor: explicitely default keepalive to disabled
This commit is contained in:
		
							
								
								
									
										10
									
								
								nginx.tmpl
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								nginx.tmpl
									
									
									
									
									
								
							@@ -249,7 +249,7 @@
 | 
			
		||||
    {{- if exists $override }}
 | 
			
		||||
    include {{ $override }};
 | 
			
		||||
    {{- else }}
 | 
			
		||||
        {{- $keepalive := first (keys (groupByLabel .Containers "com.github.nginx-proxy.nginx-proxy.keepalive")) }}
 | 
			
		||||
        {{- $keepalive := coalesce (first (keys (groupByLabel .Containers "com.github.nginx-proxy.nginx-proxy.keepalive"))) "disabled" }}
 | 
			
		||||
    location {{ .Path }} {
 | 
			
		||||
        {{- if eq .NetworkTag "internal" }}
 | 
			
		||||
        # Only allow traffic from internal clients
 | 
			
		||||
@@ -263,14 +263,14 @@
 | 
			
		||||
        root {{ trim .VhostRoot }};
 | 
			
		||||
        include fastcgi_params;
 | 
			
		||||
        fastcgi_pass {{ trim .Upstream }};
 | 
			
		||||
            {{- if $keepalive }}
 | 
			
		||||
            {{- if ne $keepalive "disabled" }}
 | 
			
		||||
        fastcgi_keep_conn on;
 | 
			
		||||
            {{- end }}
 | 
			
		||||
        {{- else if eq .Proto "grpc" }}
 | 
			
		||||
        grpc_pass {{ trim .Proto }}://{{ trim .Upstream }};
 | 
			
		||||
        {{- else }}
 | 
			
		||||
        proxy_pass {{ trim .Proto }}://{{ trim .Upstream }}{{ trim .Dest }};
 | 
			
		||||
        set $upstream_keepalive {{ if $keepalive }}true{{ else }}false{{ end }};
 | 
			
		||||
        set $upstream_keepalive {{ if ne $keepalive "disabled" }}true{{ else }}false{{ end }};
 | 
			
		||||
        {{- end }}
 | 
			
		||||
 | 
			
		||||
        {{- if (exists (printf "/etc/nginx/htpasswd/%s" .Host)) }}
 | 
			
		||||
@@ -315,8 +315,8 @@ upstream {{ .Upstream }} {
 | 
			
		||||
    # Fallback entry
 | 
			
		||||
    server 127.0.0.1 down;
 | 
			
		||||
    {{- end }}
 | 
			
		||||
    {{- $keepalive := first (keys (groupByLabel .Containers "com.github.nginx-proxy.nginx-proxy.keepalive")) }}
 | 
			
		||||
    {{- if $keepalive }}
 | 
			
		||||
    {{- $keepalive := coalesce (first (keys (groupByLabel .Containers "com.github.nginx-proxy.nginx-proxy.keepalive"))) "disabled" }}
 | 
			
		||||
    {{- if ne $keepalive "disabled" }}
 | 
			
		||||
    keepalive {{ $keepalive }};
 | 
			
		||||
    {{- end }}
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user