Skip to content
New issue

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

nginx's remote_addr always be the docker0 bridge ip #27

Open
chenjie4255 opened this issue Dec 15, 2015 · 2 comments
Open

nginx's remote_addr always be the docker0 bridge ip #27

chenjie4255 opened this issue Dec 15, 2015 · 2 comments

Comments

@chenjie4255
Copy link

I pull down this image and run as following comand:

docker run --name redirect -v ~/temp/nginx/www:/usr/share/nginx/html:ro -v ~/temp/nginx/nginx.conf:/etc/nginx/nginx.conf:ro -p 8888:80 10.20.132.153:5000/nginx

the nginx run well,
but when I check the access.log in /var/log/nginx/access.log, I found out that all the client ip($remote_addr) is the ip of docker0 bridge of the host.

I also try with this command but the issus is still.

# change -p 8888:80 to --net host
docker run --name redirect -v ~/temp/nginx/www:/usr/share/nginx/html:ro -v ~/temp/nginx/nginx.conf:/etc/nginx/nginx.conf:ro --net host 10.20.132.153:5000/nginx
@kaililleby
Copy link

did you ever figur this out?

@aderounmu-apg
Copy link

Anyone with a solution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants