mirror of
				https://github.com/thib8956/nginx-proxy
				synced 2025-11-04 02:59:20 +00:00 
			
		
		
		
	fix: Partially revert "chore: Remove support for legacy swarm"
This partially reverts commit 2494e20784
by ignoring any network named "ingress" when searching for a
container's IP address.
That commit was technically a backwards-incompatible change: Some
users use nginx-proxy with Swarm mode even though it is not fully
supported.  In such cases nginx-proxy should ignore the `ingress`
network, otherwise nginx will not be able to reach the
server (container-to-container traffic apparently doesn't work over
the Swarm `ingress` network).
The parts of that commit that examine the `SwarmNode` structure are
not reverted here because docker-gen does not currently populate that
structure -- not even when both docker-gen and the service task
container are running on the same manager node.
			
			
This commit is contained in:
		@@ -41,6 +41,14 @@
 | 
			
		||||
    {{- $ip := "" }}
 | 
			
		||||
    #     networks:
 | 
			
		||||
    {{- range sortObjectsByKeysAsc $.container.Networks "Name" }}
 | 
			
		||||
        {{- /*
 | 
			
		||||
             * TODO: Only ignore the "ingress" network for Swarm tasks (in case
 | 
			
		||||
             * the user is not using Swarm mode and names a network "ingress").
 | 
			
		||||
             */}}
 | 
			
		||||
        {{- if eq .Name "ingress" }}
 | 
			
		||||
    #         {{ .Name }} (ignored)
 | 
			
		||||
            {{- continue }}
 | 
			
		||||
        {{- end }}
 | 
			
		||||
        {{- if and (not (index $.globals.networks .Name)) (not $.globals.networks.host) }}
 | 
			
		||||
    #         {{ .Name }} (unreachable)
 | 
			
		||||
            {{- continue }}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user