目前我正在做这个configuration。
NameVirtualHost * <VirtualHost *> ServerName testsite.org ServerAdmin [email protected] 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>
这工作,但现在我需要在panel.testsite.org上使用Perl CGI来查找REMOTE_ADDR和它显示服务器的IP …因为这个代理解决方法。 什么是更好的方式,我可以执行我所需要的,而不使用代理或任何将弄乱REMOTE_ADDR的东西
鉴于您正在使用代理,您应该使用反向代理请求标头 :
X-Forwarded-For客户端的IP地址。 X-Forwarded-Host主机HTTP请求标头中客户端请求的原始主机。 X-Forwarded-Server的主机名。