Security

How to filter by geolocation in Fail2ban

In this article, we will take a look on how to exempt from banning visitors from a specific country using Fail2ban and geoip. It is assumed that Fail2ban is already installed and configured in your server.

Lets install first the geoip:

  
yum install geoip
  

Create Fail2ban action script:

  
vi /etc/fail2ban/action.d/geohostsdeny.conf
  

Copy the following script:

Setup ECC SSL for Nginx to satisfty Cloudflare Full SSL mode

Cloudflare's Full SSL mode encrypts the connection between your website visitors and CloudFlare also from CloudFlare to your server. This mode requires SSL certificate on your server. In this tutorial will show how to create SSL certificate on server and configure Nginx for SSL.

The following procedures are tested on my Linode server running Centos 7 64-bit Linux distribution.