Add proxy ip pass example

This commit is contained in:
selim13
2016-09-13 20:06:29 +03:00
parent f99df37e54
commit 1acab78fa6

View File

@@ -171,3 +171,28 @@ This image is based on a stock official Alpine image with apache2 and php5
packages from the Alpine Linux repository, so you can drop their custom
configuration files to `/etc/apache2/conf.d` and `/etc/php5/conf.d`.
## Pass user's IP from proxy
If you are planning to start a container behind proxy
(like [nginx-proxy](https://github.com/jwilder/nginx-proxy)), it will probably
be a good idea to get user's real IP instead of proxy one. For this, you can use
Apache RemoteIP module. Create a configuration file:
```apache
LoadModule remoteip_module modules/mod_remoteip.so
RemoteIPHeader X-Real-IP
RemoteIPInternalProxy nginx-proxy
```
Here `X-Real-IP` is a header name, where proxy passed user's real IP and
`nginx-proxy` is proxy host name.
Then push it to `/etc/apache2/conf.d/` directory, for example, by extending this
image:
```dockerfile
FROM selim13/phpbb:3.1
COPY remoteip.conf /etc/apache2/conf.d
```