Preserving Clients Remote Adress when running ODOO Behind Apache SSL Proxy

Eugen Don

Hello Friends,

Im am runing a ODOO Trunk behind a apache 2 ssl proxy configuration, the openerp-server listens to interface

I discovered the problem that the client ip adresses are not preserved in the log, but instead the log writes the internal ip


I have tried mod_remoteip, mod_rpaf and x-forwarded-for without any results.

Is there anyone out there who managed to sucessfully preserve the clients IP-Adresses when running ODOO behind a Apache Proxy???

thats the log:

12] "GET /web/static/src/css/base.css HTTP/1.1" 200 -
2014-08-24 11:57:13,154 20396 INFO ? werkzeug: - - [24/Aug/2014 11:57:
13] "GET /web/static/src/img/form_sheetbg.png HTTP/1.1" 304 -
2014-08-24 11:57:13,155 20396 INFO ? werkzeug: - - [24/Aug/2014 11:57:
13] "GET /web/static/src/img/logo2.png HTTP/1.1" 304 -

Heres the Vhost config: I know its a mess :D


<VirtualHost 81.x.xx.xx.:443 >
        ServerName "domain:443"
        ServerAlias "*.domain.de" // Use this if you want dbfillter on subdomain
        ServerAdmin "me@mymail.com"
        UseCanonicalName on

  ErrorLog /var/log/openerp/openerp-error.log
            CustomLog /var/log/openerp/openerp-access.log combined

            SSLCertificateFile /etc/ssl/openerp/server.crt
         SSLCertificateKeyFile /etc/ssl/openerp/server.key

        <Proxy *>
            Order deny,allow
            Allow from all
        ProxyRequests Off
        ProxyVia On
        ProxyPreserveHost On
ProxyPass / retry=1 acquire=3000 timeout=1800 Keepalive=On

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
RewriteRule ^(.*) - [E=CLIENT_IP:%{REMOTE_ADDR},L]
RequestHeader set x-forwarded-for %{CLIENT_IP}e
RemoteIPHeader x-forwarded-for


        LogLevel warn
        RequestHeader set "X-Forwarded-Proto" "https"

        # Fix IE problem (httpapache proxy dav error 408/409)
        SetEnv proxy-nokeepalive 1




1 Komentár
Ben Bernard

hi, do you have a solution for this problem? I also have similar problem when using nginx.