Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Currently I am doing this with the config.

NameVirtualHost *
<VirtualHost *>
        DocumentRoot /var/www/
        <Directory /var/www/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride All
                Order allow,deny
                allow from all

        ErrorLog /var/log/apache2/error.log
        LogLevel warn

        CustomLog /var/log/apache2/access.log combined
        ServerSignature on


<VirtualHost *>
        ProxyPass /
        ProxyPassReverse /

This works, but now I need to use a Perl CGI on the to find the REMOTE_ADDR and its displaying the server's IP...because of this proxy workaround. What is a better way I can perform what I need without using a proxy or anything that will mess up REMOTE_ADDR

share|improve this question

migrated from Jan 27 '10 at 21:43

This question came from our site for professional and enthusiast programmers.

This is a server configuration issue. Voting to send it over to SF. – Sinan Ünür Jan 27 '10 at 21:38

Given that you are using a proxy, you should be using the Reverse Proxy Request Headers:

  • X-Forwarded-For The IP address of the client.
  • X-Forwarded-Host The original host requested by the client in the Host HTTP request header.
  • X-Forwarded-Server The hostname of the proxy server.
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.