Skip to content

Instantly share code, notes, and snippets.

@Hotfirenet
Created October 11, 2017 19:03
Show Gist options
  • Save Hotfirenet/0d5fc63204ecf8f0022294c0825ab408 to your computer and use it in GitHub Desktop.
Save Hotfirenet/0d5fc63204ecf8f0022294c0825ab408 to your computer and use it in GitHub Desktop.
Fichier de nginx qui permet de retourner dans la variable bad_referer 0 ou 1 si il match avec un site défini.
map $http_referer $bad_referer {
hostnames;
default 0;
# Put regexes for undesired referers here
"~site_a_bloquer.com" 1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment