Skip to content

nginx-proxy only sees docker's virtual interface (and IP) #133

@finferflu

Description

@finferflu

My front-facing nginx-proxy container doesn't seem to see the real IP a connection is coming from; here is an example:

nginx.1    | 172.17.42.1 - - [26/Mar/2015:14:15:16 +0000] "GET / HTTP/1.1" 200 9319 "http://mydomain.com/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_2) AppleWebKit/600.4.10 (KHTML, like Gecko) Version/8.0.4 Safari/600.4.10" "-"

The IP 172.17.42.1 is actually from the virtual interface docker has created (docker0). For this reason even if I set Nginx to set the header to the real IP, it's all for nothing, since Nginx can't see the real IP to start with. So the question is how do I set nginx-proxy to see the real IP a connection is coming from? Is this something that should be rather adjusted with the Docker daemon instead?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions