LiuLiu 发表于 2014-10-8 17:22:40

如何设置并获得 X-Forwarded-For header value

本帖最后由 LiuLiu 于 2014-10-8 17:30 编辑


最近用了谷歌的page speed service 做cdn。 看说明里面需要配置服务器接受X-Forwarded-For header value来获取访客的真实ip。但是由于说明文档是英文的加上自己本来技术就差,看不懂。有没有朋友能够帮助下?


Google 的 FAQ:How do I know the client IP address for my users' requests?https://developers.google.com/speed/pagespeed/service/faq?csw=1#clientip
我是网站,应该按照Apache下面的操作吧?我的问题主要在于怎么配置 configuration file (/etc/httpd/conf/httpd.conf) with the updated configuration 呢?


vi /usr/local/apache/conf/httpd.conf
Include conf/extra/httpd-remoteip.conf
vi /usr/local/apache/conf/extra/httpd-remoteip.conf
LoadModule remoteip_module modules/mod_remoteip.so
RemoteIPHeader X-Forwarded-For
RemoteIPInternalProxy 127.0.0.1



是只需要将127.0.0.1替换成这一行代码:v=spf1 include:_spf.google.com ~all 就可以,还是必须将google的所有ip检索出来并逐个添加呢?

gger 发表于 2014-10-8 22:56:18

google还有这个服务???
页: [1]
查看完整版本: 如何设置并获得 X-Forwarded-For header value