Giter Club home page Giter Club logo

apache-nginx-referral-spam-blacklist's Introduction

apache-nginx-referral-spam-blacklist Build Status

Generator to create Apache and Nginx files plus a Google Analytics segment to prevent (old) referral spam traffic.


Apache: .htaccess usage

.htaccess is a configuration file for use on web servers running Apache. This file is usually found in the root “public_html” folder of your website. The .htaccess file uses two modules to prevent referral spam, mod_rewrite and mod_setenvif. Decide which method is most suitable with your Apache server configuration. This file is Apache 2.4 ready, where mod_authz_host got deprecated.

Nginx: referral-spam.conf usage

With referral-spam.conf in /etc/nginx, include it globally from within /etc/nginx/nginx.conf:

http {
	include referral-spam.conf;
}

Add the following to each /etc/nginx/site-available/your-site.conf that needs protection:

server {
	if ($bad_referer) {
		return 444;
	}
}

Options for old Google Analytics 'ghost' spam

UPDATE: The problem with future Google Analytics spam seems to be fixed.

The above methods don't stop the Google Analytics ghost referral spam (because they are hitting Analytics directly and don't touching your website). You should use filters in Analytics to prevent ghost referral spam.

Navigate to your Google Analytics Admin panel and add a Segment:

Filter Session Include
Hostname matches regex ```your-website.com
Filter Session Exclude
Source matches regex Copy all the domains from google-exclude.txt to this field

You can also prevent ghost referral spam by:

Like it?

apache-nginx-referral-spam-blacklist's People

Contributors

andrewgamez avatar brendanmullan avatar chrisloftus avatar delirius avatar gamesh avatar joshkoberstein avatar julianxhokaxhiu avatar oddtwelve avatar paleite avatar peterjurkovic avatar simbus82 avatar skmbr avatar thiagotalma avatar whoacowboy avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.