This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Function to get a blog/site's domain mapped url. | |
// | |
// You need to call it with a blog ID | |
// | |
// Example: | |
// $custom_blog_id = '14'; | |
// echo get_domain_mapped_url( $custom_blog_id ); | |
// |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The final "error" text at the end of the next line is crucial | |
# You can also use any of the following in it's place: | |
# "debug | info | notice | warn | error | crit | alert | emerg" | |
error_log /dir/to/your/nginx/site.log error; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.user-select(@user-select) { | |
-webkit-touch-callout: @user-select; | |
-webkit-user-select: @user-select; | |
-khtml-user-select: @user-select; | |
-moz-user-select: @user-select; | |
-ms-user-select: @user-select; | |
user-select: @user-select; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set $posting 0; # Make sure to declare it first to stop any warnings | |
if ($request_method = POST) { # Check if request method is POST | |
set $posting N; # Initially set the $posting variable as N | |
} | |
if ($geoip_country_code ~ (BR|CN|KR|RU|UA) ) { # Here we're using the Nginx GeoIP module to block some spammy countries | |
set $posting "${posting}O"; # Set the $posting variable to itself plus the letter O | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php require_once('/var/www/wordpress/wp-load.php'); ?> | |
<script type="text/javascript"> | |
jQuery(document).ready(function() { | |
jQuery('header.top-head').css('background-image', 'url(<?php header_image(); ?>)'); | |
}); | |
</script> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sub vcl_fetch { | |
set beresp.do_esi = true; | |
if (req.url ~ "header-esi.php"){ | |
std.log("ESI found, don't cache, pass to nginx"); | |
set client.identity = clusternginx; | |
return(hit_for_pass); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<head> | |
<esi:include src="/wp-content/themes/random/header-esi.php"/> | |
</head> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Fail2Ban configuration file | |
# | |
# Author: Charles Lecklider | |
# | |
[INCLUDES] | |
# Read common prefixes. If any customizations available -- read them from | |
# common.local | |
before = common.conf |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[wordpress-admin] | |
enabled = true | |
filter = wordpress-admin | |
action = iptables-allports[name=PrimaryBlogger-admin, protocol=all] | |
logpath = /var/log/nginx/pblogger-error.log | |
findtime = 10800 | |
bantime = 86400 | |
maxretry = 2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action('wp_login_failed', 'log_wp_login_fail'); | |
function log_wp_login_fail($username) { | |
$ip = ($_SERVER['REMOTE_ADDR'] != '127.0.0.1') ? $_SERVER['REMOTE_ADDR'] : $_SERVER['X_FORWARDED_FOR']; | |
error_log("Authentication failure for $username from {$ip}"); | |
} |