Set REMOTE_ADDR to X-Forwarded-For in apache

前端 未结 9 1097
感情败类
感情败类 2020-12-29 10:06

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 tha

9条回答
  •  孤城傲影
    2020-12-29 10:22

    In addition to mod_rpaf as mentioned before, it appears that mod_extract_forwarded will perform this function as well.

    One advantage to mod_extract_forwarded is that it is available from EPEL for RHEL/CentOS servers whereas mod_rpaf is not.

    It appears that neither of these two modules allow you to whitelist an entire subnet of proxy servers, which is why the CloudFlare folks created their own plugin: mod_cloudflare which, it should be noted, is not a general-purpose tool like the other two; it contains a hardcoded list of CloudFlare subnets.

提交回复
热议问题