0

I have this configuration in my Apache virtualhost :

<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>

But on Play Framework, asking for the client IP (request.remoteAddress) results in a 127.0.0.1.

I'm sure it's because of the proxy, but I don't know which parameter to set to make this works.

Thanks for your help !

1 Answer 1

2

When using a proxy server, you need to look at the X-Forwarded-For header instead of the remote address (source IP).

2
  • Exactly! That was the way to look. But I had to add XForwardedSupport=127.0.0.1 in the application.conf file to make this works. You set me on the right track. Thanks!
    – Cyril N.
    Apr 17, 2012 at 11:47
  • Nice to hear that from you!
    – Khaled
    Apr 17, 2012 at 11:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .