Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Currently I am doing this with the config.

NameVirtualHost *
<VirtualHost *>
        ServerName testsite.org
        ServerAdmin webmaster@testsite.org
        DocumentRoot /var/www/
        <Directory /var/www/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride All
                Order allow,deny
                allow from all
        </Directory>

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

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

</VirtualHost>

<VirtualHost *>
        ServerName panel.testsite.org
        ProxyPass / http://panel.testsite.org:10000/
        ProxyPassReverse / http://panel.testsite.org:10000/
</VirtualHost>

This works, but now I need to use a Perl CGI on the panel.testsite.org 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 stackoverflow.com 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

1 Answer 1

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

 
discard

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