Skip to content

Instantly share code, notes, and snippets.

@jdorfman
Created April 26, 2012 17:26
Show Gist options
  • Save jdorfman/2501118 to your computer and use it in GitHub Desktop.
Save jdorfman/2501118 to your computer and use it in GitHub Desktop.
nginx - return a 403 response for certain referers
#place this in nginx.conf or a vhosts
if ($http_referer ~* (keyword|domain.com|www.domain.com))
{ return 403; }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment