通过代理的apache请求获取正确的remoteAddress

我在我的Apache虚拟主机中有这个configuration:

<VirtualHost *:80> ServerAdmin [email protected] ServerName black-frames.net ProxyPreserveHost On ProxyPass / http://127.0.0.1:9150/ ProxyPassReverse / http://127.0.0.1:9150/ ErrorLog /var/log/apache2/blackframes_error.log LogLevel warn CustomLog /var/log/apache2/blackframes_access.log combined ServerSignature Off </VirtualHost> 

但在Play Framework上,请求客户端IP(request.remoteAddress)的结果是127.0.0.1

我确定这是因为代理,但我不知道要设置哪个参数。

谢谢你的帮助 !

使用代理服务器时,您需要查看X-Forwarded-For标题而不是远程地址(源IP)。