Original ip is not passed to containers [Linux version]
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:
- Run any apache container and default php_fpm container on the same node.
- Connect both container by adding the config ProxyPassMatch ^/(..php(/.)?)$ fcgi://localhost:9000/
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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