REMOTE_ADDR设置为x - 转发,对于阿帕奇 [英] Set REMOTE_ADDR to X-Forwarded-For in apache

查看:697
本文介绍了REMOTE_ADDR设置为x - 转发,对于阿帕奇的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在哪里Apache是​​坐在后面反向代理(如鱿鱼),CGI环境变量 REMOTE_ADDR 的情况下获得代理服务器的地址,而不是客户端。

In a situation where Apache is sitting behind a reverse proxy (such as Squid), the cgi environment variable REMOTE_ADDR gets the address of the proxy rather than the client.

不过,代理将设置一个名为 X-转发-For头来包含客户端的原始IP地址,以便Apache可以看到它。

However, the proxy will set a header called X-Forwarded-For to contain the original IP address of the client so that Apache can see it.

现在的问题是,我们如何让Apache来与价值替换 REMOTE_ADDR X-转发,对于头,使所有的Web应用程序将透明地看到正确的地址吗?

The question is, how do we get Apache to replace REMOTE_ADDR with the value in the X-Forwarded-For header so that all of the web applications will transparently see the correct address?

推荐答案

您可以使用mod_rpaf了点。 http://stderr.net/apache/rpaf/

You can use mod_rpaf for that. http://stderr.net/apache/rpaf/

这篇关于REMOTE_ADDR设置为x - 转发,对于阿帕奇的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆