We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello,
By setting nginx-proxy with docker-compose and an external network the remote ip address is the internal IP address and not the client IP address.
nginx-proxy
docker-compose
version: '2' services: app: image: node:12-alpine restart: always command: sh -c "npm install && npm start" working_dir: /app expose: - 3000 volumes: - ./dist:/app environment: - VIRTUAL_HOST=domain.com - VIRTUAL_PORT=3000 proxy: image: jwilder/nginx-proxy restart: always ports: - "80:80" - "443:443" volumes: - ./vhost.d:/etc/nginx/vhost.d - ./certs:/etc/nginx/certs:ro - ./html:/usr/share/nginx/html - /var/run/docker.sock:/tmp/docker.sock:ro environment: - ENABLE_IPV6=true logging: driver: "none" networks: default: external: name: nginx-proxy
Result:
'x-real-ip': '172.23.0.1', 'x-forwarded-for': '172.23.0.1', 'x-forwarded-proto': 'https', 'x-forwarded-ssl': 'on', 'x-forwarded-port': '443',
The text was updated successfully, but these errors were encountered:
After a lot of research I noticed that it was a real problem with docker and that help on this subject is quite poor.
Concretely, the solution that worked for me is to add network_mode: 'host' in nginx-proxy to get the correct ip address.
network_mode: 'host'
In the case of a docker-dial version 3 it is necessary to follow this syntax: moby/moby#25526 (comment)
I think an addition to the documentation will not be too much.
Sorry, something went wrong.
Can you show an example of your config?
This issue is related to docker/roadmap#157
I am also experiencing this problem, and seems like the network_mode: host is the only solution now.
network_mode: host
network_mode: host only works on Linux and is not suitable for any other platform.
No branches or pull requests
Hello,
By setting
nginx-proxy
withdocker-compose
and an external network the remote ip address is the internal IP address and not the client IP address.Result:
The text was updated successfully, but these errors were encountered: