Skip to content

Instantly share code, notes, and snippets.

@benediktg
Last active April 23, 2018 15:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save benediktg/948a70136e2104c8601da7d355061323 to your computer and use it in GitHub Desktop.
Save benediktg/948a70136e2104c8601da7d355061323 to your computer and use it in GitHub Desktop.
Nginx config for Privatebin's .htaccess

Nginx config for Privatebin's .htaccess

(source of the .htaccess: https://github.com/PrivateBin/PrivateBin/blob/master/.htaccess.disabled)

Put this into your http context:

map $http_user_agent $pastebin_badagent {
    ~*bot 1;
    ~*spider 1;
    ~*crawl 1;
    ~https?:// 1;
    WhatsApp 1;
    SkypeUriPreview 1;
    facebookexternalhit 1;
}

And this into your privatebin's server context:

if ($pastebin_badagent) {
    return 403;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment