Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions blacklist.conf
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,3 @@ map $http_user_agent $bad_bot {
libwww-perl 1;
~(?i)(httrack|htmlparser|libwww) 1;
}

## Add here all referrers that are to blocked.
map $http_referer $bad_referer {
default 0;
~(?i)(babes|click|diamond|forsale|girl|jewelry|love|nudit|organic|poker|porn|poweroversoftware|sex|teen|webcam|zippo|casino|replica) 1;
}
50 changes: 49 additions & 1 deletion mime.types
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,12 @@
types {
text/html html htm shtml;
text/css css;
text/xml xml rss;
text/xml xml;
image/gif gif;
image/jpeg jpeg jpg;
application/x-javascript js;
application/atom+xml atom;
application/rss+xml rss;

text/mathml mml;
text/plain txt;
Expand All @@ -32,6 +33,49 @@ types {
application/vnd.ms-powerpoint ppt;
application/vnd.wap.wmlc wmlc;
application/vnd.wap.xhtml+xml xhtml;
application/vnd.google-earth.kml+xml kml;
application/vnd.google-earth.kmz kmz;

application/vnd.oasis.opendocument.chart odc;
application/vnd.oasis.opendocument.chart-template otc;
application/vnd.oasis.opendocument.database odb;
application/vnd.oasis.opendocument.formula odf;
application/vnd.oasis.opendocument.formula-template odft;
application/vnd.oasis.opendocument.graphics odg;
application/vnd.oasis.opendocument.graphics-template otg;
application/vnd.oasis.opendocument.image odi;
application/vnd.oasis.opendocument.image-template oti;
application/vnd.oasis.opendocument.presentation odp;
application/vnd.oasis.opendocument.presentation-template otp;
application/vnd.oasis.opendocument.spreadsheet ods;
application/vnd.oasis.opendocument.spreadsheet-template ots;
application/vnd.oasis.opendocument.text odt;
application/vnd.oasis.opendocument.text-master otm;
application/vnd.oasis.opendocument.text-template ott;
application/vnd.oasis.opendocument.text-web oth;

application/vnd.openofficeorg.extension oxt;

application/vnd.openxmlformats-officedocument.presentationml.presentation pptx;
application/vnd.openxmlformats-officedocument.presentationml.slide sldx;
application/vnd.openxmlformats-officedocument.presentationml.slideshow ppsx;
application/vnd.openxmlformats-officedocument.presentationml.template potx;
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet xlsx;
application/vnd.openxmlformats-officedocument.spreadsheetml.template xltx;
application/vnd.openxmlformats-officedocument.wordprocessingml.document docx;
application/vnd.openxmlformats-officedocument.wordprocessingml.template dotx;

application/vnd.sun.xml.calc sxc;
application/vnd.sun.xml.calc.template stc;
application/vnd.sun.xml.draw sxd;
application/vnd.sun.xml.draw.template std;
application/vnd.sun.xml.impress sxi;
application/vnd.sun.xml.impress.template sti;
application/vnd.sun.xml.math sxm;
application/vnd.sun.xml.writer sxw;
application/vnd.sun.xml.writer.global sxg;
application/vnd.sun.xml.writer.template stw;

application/x-7z-compressed 7z;
application/x-cocoa cco;
application/x-java-archive-diff jardiff;
Expand Down Expand Up @@ -61,6 +105,7 @@ types {
application/octet-stream dmg;
application/octet-stream iso img;
application/octet-stream msi msp msm;
application/octet-stream vcf;

audio/midi mid midi kar;
audio/mpeg mp3;
Expand All @@ -74,4 +119,7 @@ types {
video/x-ms-asf asx asf;
video/x-ms-wmv wmv;
video/x-msvideo avi;
video/ogg ogv;
video/webm webm;
video/mp4 mp4;
}
2 changes: 1 addition & 1 deletion nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ http {
## Uncomment to enable if you're running php-fpm.
#include php_fpm_status_allowed_hosts.conf;

## Include blacklist for bad bot and referer blocking.
## Include blacklist for bad bot blocking.
include blacklist.conf;

## Include all vhosts.
Expand Down
4 changes: 0 additions & 4 deletions sites-available/example.com.conf
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@ server {
if ($bad_bot) {
return 444;
}
## Deny access based on the Referer header.
if ($bad_referer) {
return 444;
}

## Filesystem root of the site and index.
root /var/www/sites/example.com;
Expand Down