如何在nginx access.log中获得真正的ip

时间:2017-09-06 18:12:47

标签: nginx joomla recaptcha iptables fail2ban

我有一个很大的问题。我的网站通过joomla联系表格发送垃圾邮件。在nginx access.log中我只看到:

  

10.50.0.1 - - [06 / Sep / 2017:19:57:32 +0200]" GET /index.php/en/kontakt HTTP / 1.1" 200 16132" http://polskaszkolaslough.org/index.php/en/kontakt" " Mozilla / 4.0(兼容; MSIE 9.0; Windows NT 6.1)"   10.50.0.1 - - [06 / Sep / 2017:19:57:32 +0200]" POST /index.php/en/kontakt HTTP / 1.1" 301 193" http://polskaszkolaslough.org/index.php/en/kontakt" " Mozilla / 4.0(兼容; MSIE 9.0; Windows NT 6.1)"   10.50.0.1 - - [06 / Sep / 2017:19:57:34 +0200]" POST /index.php/en/kontakt HTTP / 1.1" 301 193" http://polskaszkolaslough.org/index.php/en/kontakt" " Mozilla / 4.0(兼容; MSIE 9.0; Windows NT 6.1)"   10.50.0.1 - - [06 / Sep / 2017:19:57:34 +0200]" GET /index.php/en/kontakt HTTP / 1.1" 301 193" http://polskaszkolaslough.org/index.php/en/kontakt" " Mozilla / 4.0(兼容; MSIE 9.0; Windows NT 6.1)"   10.50.0.1 - - [06 / Sep / 2017:19:57:34 +0200]" GET /index.php/en/kontakt HTTP / 1.1" 301 193" http://polskaszkolaslough.org/index.php/en/kontakt" " Mozilla / 4.0(兼容; MSIE 9.0; Windows NT 6.1)"   10.50.0.1 - - [06 / Sep / 2017:19:57:36 +0200]" GET /index.php/en/kontakt HTTP / 1.1" 200 16132" http://polskaszkolaslough.org/index.php/en/kontakt" " Mozilla / 4.0(兼容; MSIE 9.0; Windows NT 6.1)"   10.50.0.1 - - [06 / Sep / 2017:19:57:37 +0200]" GET /index.php/en/kontakt HTTP / 1.1" 301 193" http://polskaszkolaslough.org/index.php/en/kontakt" " Mozilla / 4.0(兼容; MSIE 9.0; Windows NT 6.1)"   10.50.0.1 - - [06 / Sep / 2017:19:57:37 +0200]" GET /index.php/en/kontakt HTTP / 1.1" 200 16132" http://polskaszkolaslough.org/index.php/en/kontakt" " Mozilla / 4.0(兼容; MSIE 9.0; Windows NT 6.1)"   10.50.0.1 - - [06 / Sep / 2017:19:57:37 +0200]" GET /index.php/en/kontakt HTTP / 1.1" 301 193" http://polskaszkolaslough.org/index.php/en/kontakt" " Mozilla / 4.0(兼容; MSIE 9.0; Windows NT 6.1)"

当我打开Linux命令尾时,新请求一个接一个地出现。这太震撼了!我的网站很慢。我有私有服务器与公共IP。我的本地IP是:10.50.0.6,网关是:10.50.0.1 DNS是我的域提供商和记录A将流量转发到我的公共IP,然后路由器转发到我的本地IP。我想阻止ip范围发送垃圾邮件我的域名,但我没有看到原始地址。我只看到我的网关IP。我安装了fail2ban,我将reCaptha添加到联系表单中,但没有帮助。我该如何解决这个问题?

1 个答案:

答案 0 :(得分:0)

您需要访问路由器。

路由器应该能够记录它所做的地址转换,并且通过将这些日志与您的nginx日志进行比较,您应该能够识别原始IP地址。路由器还应该能够实现访问列表,以便您可以阻止原始IP地址。