I am currently setting up a nginx proxy for apache2 in digital ocean. I am not really an Admin Person but I followed this tutorial https://www.digitalocean.com/community/tutorials/how-to-configure-nginx-as-a-web-server-and-reverse-proxy-for-apache-on-one-ubuntu-14-04-droplet. He said that "The REMOTE_ADDR variable will now also be that of your local computer's public IP address",

Here is my rpaf.conf

<IfModule mod_rpaf.c> RPAF_Enable On RPAF_Header X-Real-Ip RPAF_ProxyIPs RPAF_SetHostName On RPAF_SetHTTPS On RPAF_SetPort On </IfModule>

However, It's the server IP address showing on REMOTE_ADDR. Is this OK?


You need to add the server's address to RPAF_ProxyIPs.

The page you linked contains an example configuration which redirects every request to the server's external IP address. I'm talking about this one:

server {
  listen 80;
  server_name foobar.net www.foobar.net test.io www.test.io;

  location / {
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;

Here, the address is supposed to be the server's real IP address. If you changed that to your server's address, Apache will see the connection originated from the server's external interface (and pointing to the very same interface). For this, the RPAF's ProxyIPs setting should contain the server's external address, since that is the one supplying the proxy information.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.