I am attempting to configure an apache server behind a nginx proxy. The nginx and apache instances take presctiption two different hosts. Boths servers are running debian squeeze.

I've this within the nginx.conf from the front server (192.168.1.30)

 server {

    listen   80; ## listen for ipv4
    listen   [::]:80 default ipv6only=on; ## listen for ipv6

    server_name  front.tld.org;  #real hostname changed

    access_log  /var/log/nginx/localhost.access.log;

    proxy_set_header   Host             $host;
    proxy_set_header   X-Real-IP        $remote_addr;
    proxy_set_header   X-Forwarded-For  $proxy_add_x_forwarded_for;

    location / {
      proxy_pass http://192.168.1.1:80;  #local IP of the server running apache
    }

Around the apache host (192.168.1.1), /etc/apache2/mods-enabled/rpaf.conf:

<IfModule mod_rpaf.c>
RPAFenable On
RPAFsethostname On
RPAFproxy_ips 192.168.1.30
RPAFheader X-Real-IP
</IfModule>

I restarted both nginx and apache2 services. In the apache2 /var/log/apache2/access.log I usually come with an coming initially from IP from 192.168.1.30 (the proxy) rather than the actual client.

Can there be anything wrong ? Any concept of how you can debug ?

A specific item right now may be the correct behavior. Since your programs (operate on Apache) begin to see the real IP. For instance, use a sample application for example WordPress and install real-time statistics for example Piwik. Place the Piwik code in WordPress footer and go to your WordPress site (after logging out). The Piwik would show the actual IP rather than what's set at RPAFproxy_insolvency practitioners.