docker / docker/cli

Original ip is not passed to containers [Linux version]

Open
#2,945 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
6.1k
Forks
2.2k
Avg merge
1d 15h
Merged PRs (30d)
43

Description

-->

Refering to a similar problem seen in docker for-mac
I'm using Apache inside an alpine docker-container within kubernetes node replication environnement
This container use ProxyPassMatch to serve the php container

Within the php container i try to gather the user's IP with echo $_SERVER["REMOTE_ADDR"].
The ouput shows the IP of the node hosting the container instead of the ip of the end user

Steps to reproduce the issue:

  1. Run any apache container and default php_fpm container on the same node.
  2. Connect both container by adding the config ProxyPassMatch ^/(..php(/.)?)$ fcgi://localhost:9000/
  3. Create a php file on the php container:

Result will be the adress of the node instead of the client

**Additional information you deem important **

Output of docker version:

(paste your output here)

Output of docker info:

(paste your output here)

Additional environment details (AWS, VirtualBox, physical, etc.):

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the setup with an Apache container, a PHP-FPM container, Kubernetes node replication, and the stated ProxyPassMatch configuration. Inspect how the client address reaches PHP's $_SERVER["REMOTE_ADDR"]; done means the PHP container reports the end user's IP instead of the hosting node's address.

Written by the indexing model from the issue text.

Assessment

Tech stack
apache, docker, kubernetes, php
Domain
infrastructure, networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.