nginx-proxy icon indicating copy to clipboard operation
nginx-proxy copied to clipboard

resolve services by alias, not ip

Open ifokeev opened this issue 3 years ago • 4 comments

I'm wondering why nginx-proxy is resolving proxy_pass as IP but not service alias name? It looks like I have issues with nginx-proxy on multi node swarm setup

ifokeev avatar Apr 29 '21 08:04 ifokeev

Yeh, that's a known issue. Nginx-proxy uses ip instead of dns, and it can see containers running on the same host only.

Advantage of this is, nginx doesn't have to resolve DNS and the requests don't hop to another other server.

In my swarm setup I am using a workaround. I run running nginx-proxy with mode=global and restrict the placement of the containers to be exposed and then I update my dns for that service to the node on which It will run.

mesudip avatar May 02 '21 08:05 mesudip

@mesudip but it requires a simple fix to work with aliases

ifokeev avatar May 02 '21 09:05 ifokeev

Indeed, may be I should make it possible to configure what to use with an Environment Variable

mesudip avatar May 03 '21 17:05 mesudip

@mesudip it would be wonderful if you may add the fix

ifokeev avatar May 03 '21 19:05 ifokeev