站点图标 江湖人士

使用WP安全插件偶尔重定向到127.0.0.1解决方法

美腿运动教你轻松消除大腿內侧肥肉

美腿运动教你轻松消除大腿內侧肥肉

当我们在互联网上使用国外VPS + WordPress 建立了一个属于自己的网站后,使用WP安全插件偶尔重定向到首页解决方法,你就可以开始运营它,并享受它带来的被动收入,只要你长久坚持运营你的网站,赚钱只是一个时间问题;不过随着网站运营,你可能选择安装了WP安全插件,英文名是:All In One WordPress Security Plugin

WP安全插件偶尔重定向到127.0.0.1

早些年的时候,江湖人士网并安装了WP安全插件并没有出现这个问题,不过去年到今年的时候,偶尔会出现跳转到127.0.0.1的问题,之前也没有太多的时间排查是什么原因造成的,但估计是All In One WordPress Security Plugin的问题,因为一旦将它禁用,就不会出现跳转到首页或者127.0.0.1这个地址。

All In One WordPress Security Plugin这款插件是下载安装量较大的一款WP网站安全插件,具体的用法见这篇文章:

那这个问题又是如何解决呢?闲来无事,在网上搜索到可能是设置不当造成的,假如正好你的网站套了国外免费CDN的话,再加上你安装了All In One WordPress Security Plugin插件可能就会触发此问题。

使用WP安全插件偶尔重定向到127.0.0.1解决方法

如何解决?

Maybe your case was different from mine, but I want to share with you how I fixed this issue, hoping will be useful for other people.

In my case the issue was caused by All In One WordPress Security Plugin (AIOWS), due to “IP RETRIEVAL SETTINGS” configuration.

My site is hosted on AWS, via Elastic Beanstalk environment and I have different instances under a load balancer. In this case seems the last version of this plugin is no more able to correctly detect the IP of the clients and so start blocking them by redirecting to 127.0.0.1

I fixed this issue by simply changing that configuration from “REMOTE_ADDR (Default)” to “HTTP_X_FORWARDED_FOR”.

You can change this from: “WP Security” => “Settings” => “Advanced Settings”:

点击阅读原文

以上就是问题的根源,知道了问题的根源,那么我们只需要根据提示解决就好了,因为本站是中文站,只需要按下图所示找到:WP安全 =>设置=>Advanced settings(高级设置)

使用WP安全插件偶尔重定向到127.0.0.1解决方法 3

选中:HTTP_CF_CONNECTING_IP (current value: 210.68.1.9) (Only use if you’re using Cloudflare.) 正好对应了CF,然后保存即可,这样就不会出现偶尔自动跳转到网站首页的问题。

相关阅读:

  1. 国外vps推荐,国外便宜vps推荐
  2. 新手如何搭建博客网站赚钱呢
  3. 国外虚拟主机推荐
  4. 最新Google Adsense教程
  5. 这3个国外网赚项目不错哟,懒人挂机赚钱好方
退出移动版