REMOTE_ADDR设置为x - 转发,对于阿帕奇 [英] Set REMOTE_ADDR to X-Forwarded-For in apache
问题描述
在哪里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屋!