Just in case post the configs.
wp-config.php
<?php
/** Enable W3 Total Cache */
define('WP_CACHE', true); // Added by W3 Total Cache
/* Turn HTTPS 'on' if HTTP_X_FORWARDED_PROTO matches 'https' */
if (strpos($_SERVER['HTTP_X_FORWARDED_PROTO'], 'https') !== false)
$_SERVER['HTTPS']='on';
// Code for showing correct client IP address
if ( isset( $_SERVER['HTTP_X_FORWARDED_FOR'] ) ) {
$mte_xffaddrs = explode( ',', $_SERVER['HTTP_X_FORWARDED_FOR'] );
$_SERVER['REMOTE_ADDR'] = $mte_xffaddrs[0];
}
define('FORCE_SSL_ADMIN', true);
define('FORCE_SSL_LOGIN', true);
define('WP_FAIL2BAN_PROXIES','10.0.0.1');
include __DIR__.'/wp-content/plugins/wp-fail2ban/lib/constants.php';
define('WP_FAIL2BAN_LOG_SPAM', true);
define('WP_FAIL2BAN_PLUGIN_LOG_SPAM', true);
define('WP_FAIL2BAN_BLOCK_USER_ENUMERATION', true);
define('WP_FAIL2BAN_LOG_PASSWORD_REQUEST', true);
define('WP_FAIL2BAN_PLUGIN_LOG_XMLRPC', true);
define('WP_FAIL2BAN_PLUGIN_LOG_REST', true);
define('WP_FAIL2BAN_LOG_PINGBACKS', true);
define('WP_FAIL2BAN_COMMENT_LOG', LOG_LOCAL7);
define('WP_FAIL2BAN_LOG_COMMENTS', true);
define('WP_FAIL2BAN_COMMENT_EXTRA_LOG', LOG_LOCAL7);
define('WP_FAIL2BAN_LOG_COMMENTS_EXTRA', WPF2B_EVENT_COMMENT_NOT_FOUND | WPF2B_EVENT_COMMENT_CLOSED | WPF2B_EVENT_COMMENT_TRASH | WPF2B_EVENT_COMMENT_DRAFT | WPF2B_EVENT_COMMENT_PASSWORD);
define('DB_NAME', 'mysite_202010');
define('DB_USER', 'user');
define('DB_PASSWORD', 'pAs$woRt');
define('DB_HOST', '10.0.0.15');
define('DB_CHARSET', 'utf8');
define('DB_COLLATE', '');
@ini_set( ‘upload_max_size’ , ’10MB’ );
@ini_set( ‘post_max_size’, ’15MB’);
define('WP_HOME','https://mysite.com');
define('WP_SITEURL','https://mysite.com');
define( 'WP_REDIS_CLIENT', 'pecl' );
define( 'WP_REDIS_SCHEME', 'tcp' );
define( 'WP_REDIS_HOST', '10.0.0.16' );
define( 'WP_REDIS_PORT', '6379' );
define( 'WP_REDIS_DATABASE', '0' );
define('AUTH_KEY', 'dfhrdst');
define('SECURE_AUTH_KEY', 'xtgdfbx');
define('LOGGED_IN_KEY', 'xbcvbrftgbret');
define('NONCE_KEY', 'rthergtbgfbd');
define('AUTH_SALT', 'xcfbgxfthdrt');
define('SECURE_AUTH_SALT', 'mjutyurtghn');
define('LOGGED_IN_SALT', 'nyhyujmghn');
define('NONCE_SALT', 'gfbnrtyghjtry');
$table_prefix = 'wp_';
define('WPLANG', 'ru_RU');
define('WP_MEMORY_LIMIT', '128M');
define( 'AUTOMATIC_UPDATER_DISABLED', true );
define( 'DISALLOW_FILE_EDIT', true );
define('WP_DEBUG', false);
if ( ! defined( 'ABSPATH' ) ) {
define( 'ABSPATH', __DIR__ . '/' );
}
require_once(ABSPATH . 'wp-settings.php');
if ( ! empty( $_SERVER['HTTP_X_FORWARDED_FOR'] ) && $_SERVER["REMOTE_ADDR"] == "10.10.0.1") { $forwardip = explode(",", $_SERVER['HTTP_X_FORWARDED_FOR']); $_SERVER['REMOTE_ADDR'] = $forwardip[0];}
nginx-proxy.conf
user www;
worker_processes auto;
worker_rlimit_nofile 1024;
pcre_jit on; # Offers a performance boost to regular expression processing
worker_priority 10;
error_log /var/log/nginx/error.nc.log warn;
events {
worker_connections 1024;
use kqueue; # No epoll on FreeBSD
}
http {
client_body_timeout 5s; # maximum time between packets the client can pause when sending nginx any data
client_header_timeout 5s; # maximum time the client has to send the entire header to nginx
#keepalive_timeout 75s; # timeout which a single keep-alive client connection will stay open
keepalive_timeout 300 300;
send_timeout 15s; # maximum time between packets nginx is allowed to pause when sending the client data
## General Options
aio on; # asynchronous file I/O, fast with ZFS, make sure sendfile=off
charset utf-8; # adds the line "Content-Type" into response-header, same as "source_charset"
default_type application/octet-stream;
gzip_proxied any; # allows compressed responses for any request even from proxies
gzip_vary on; # send response header "Vary: Accept-Encoding"
ignore_invalid_headers on;
include mime.types;
keepalive_disable none; # allow all browsers to use keepalive connections
keepalive_requests 50; # number of requests per connection, does not affect SPDY
max_ranges 0; # disabled to stop range header DoS attacks as resumed downloads are denied
msie_padding off;
output_buffers 1 512;
postpone_output 1460; # postpone sends to match our machine's MSS
proxy_headers_hash_bucket_size 128;
proxy_headers_hash_max_size 1024;
read_ahead 512K; # kernel read head set to the output_buffers
recursive_error_pages on;
reset_timedout_connection on; # reset timed out connections freeing ram
sendfile off; # on for decent direct disk I/O
server_tokens off; # version number in error pages
server_name_in_redirect off; # if off, nginx will use the requested Host header
source_charset utf-8; # same value as "charset"
tcp_nodelay on; # Nagle buffering algorithm, used for keepalive only
tcp_nopush on; #highly recommend testing your server with this option enabled
## Log Format
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main buffer=32k;
proxy_http_version 1.1;
proxy_connect_timeout 900;
proxy_send_timeout 900;
proxy_read_timeout 900;
proxy_intercept_errors on;
proxy_buffering off;
set_real_ip_from 10.0.0.1;
real_ip_header X-Forwarded-For;
limit_req_zone $binary_remote_addr zone=gulag:10m rate=1250r/m;
add_header Cache-Control "public";
add_header X-Frame-Options SAMEORIGIN always;
listen 10.0.0.1:80;
limit_req zone=gulag burst=500 nodelay;
server_name mysite.com www.mysite.com;
client_max_body_size 5M;
proxy_cache off;
proxy_redirect off;
location / {
return 301 https://$host$request_uri;
}
}
server {
add_header Cache-Control "public";
add_header X-Frame-Options SAMEORIGIN always;
limit_req zone=gulag burst=500 nodelay;
listen 10.0.0.1:443 default_server ssl http2 sndbuf=512k reuseport accept_filter=dataready;
server_name mysite.com www.mysite.com;
access_log /var/log/nginx/access.mysitecom.log main buffer=32k;
error_log /var/log/nginx/error.mysitecom.log warn;
proxy_buffering off;
proxy_request_buffering off;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Port $server_port;
proxy_set_header X-Forwarded-Proto $scheme;
ssl_certificate /usr/local/acme/mysitecom/rsa-certs/fullchain.pem;
ssl_certificate_key /usr/local/acme/mysitecom/rsa-certs/privkey.pem;
ssl_trusted_certificate /usr/local/acme/mysitecom/rsa-certs/chain.pem;
ssl_certificate /usr/local/acme/mysitecom/ecc-certs/fullchain.pem;
ssl_certificate_key /usr/local/acme/mysitecom/ecc-certs/privkey.pem;
ssl_dhparam /etc/ssl/certs/dhparam.pem;
ssl_session_timeout 1d;
ssl_session_cache shared:le_nginx_SSL:10m;
ssl_prefer_server_ciphers off; # off for TLSv1.3 so clients assumed cipher is used, save one(1) round trip
ssl_session_tickets on; # off for Perfect Forward Secrecy (PFS)
ssl_buffer_size 128k;
ssl_protocols TLSv1.3 TLSv1.2;
ssl_ciphers 'TLS-AES-128-GCM-SHA256:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-CHACHA20-POLY1305:TLS-CHACHA20-POLY1305-SHA256:TLS-AES-256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA512:DHE-RSA-AES256-GCM-SHA512:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA384';
ssl_ecdh_curve secp521r1:secp384r1;
ssl_stapling on;
resolver 9.9.9.9 8.8.8.8 valid=30s;
resolver_timeout 5s;
proxy_set_header Early-Data $ssl_early_data;
location / {
proxy_pass http://10.0.0.3:80;
http2_push_preload on;
}
}
nginx-backend.conf
user www;
worker_processes auto;
worker_priority 15; # renice workers to reduce priority compared to system processes for
# machine health. worst case nginx will get ~25% system resources at nice=15
worker_rlimit_nofile 1024; # maximum number of open files
pcre_jit on;
load_module /usr/local/libexec/nginx/ngx_http_naxsi_module.so;
events {
use kqueue; # No epoll on FreeBSD
worker_connections 1024;
}
http {
include /usr/local/etc/nginx/naxsi_core.rules;
client_body_timeout 10s; # maximum time between packets the client can pause when sending nginx any data
client_header_timeout 10s; # maximum time the client has to send the entire header to nginx
keepalive_timeout 75s; # timeout which a single keep-alive client connection will stay open
send_timeout 15s; # maximum time between packets nginx is allowed to pause when sending the client data
## General Options
aio on; # asynchronous file I/O, fast with ZFS, make sure sendfile=off
charset utf-8; # adds the line "Content-Type" into response-header, same as "source_charset"
default_type application/octet-stream;
gzip_static on; # precompress content (gzip -1) with an external script
gzip off; # disable on the fly gzip compression due to higher latency, only use gzip_static
gzip_vary on; # send response header "Vary: Accept-Encoding"
gzip_proxied any; # allows compressed responses for any request even from proxies
include gzip_types;
ignore_invalid_headers on;
include mime.types;
keepalive_requests 50; # number of requests per connection, does not affect SPDY
keepalive_disable none; # allow all browsers to use keepalive connections
max_ranges 1;
msie_padding off;
open_file_cache max=1000 inactive=30d;
open_file_cache_errors on;
open_file_cache_min_uses 1;
open_file_cache_valid 1h;
output_buffers 2 512k; # 1MB for gigabit/sec outward bandwidth, 1 buffer for static content
postpone_output 1460; # postpone sends to match our machine's MSS
read_ahead 512K; # kernel read head set to the output_buffers
recursive_error_pages on;
reset_timedout_connection on; # reset timed out connections freeing ram
sendfile off; # on for decent direct disk I/O
server_tokens off; # version number in error pages
server_name_in_redirect off; # if off, nginx will use the requested Host header
source_charset utf-8; # same value as "charset"
tcp_nodelay on; # Nagle buffering algorithm, used for keepalive only
tcp_nopush on; #highly recommend testing your server with this option enabled
set_real_ip_from 10.0.0.1;
real_ip_header X-Forwarded-For;
limit_req_zone $binary_remote_addr zone=gulag:5m rate=1000r/m;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
server {
add_header Cache-Control "public";
add_header X-Frame-Options SAMEORIGIN always;
limit_req zone=gulag burst=500 nodelay;
listen 10.0.0.3:80 sndbuf=512k accept_filter=httpready;
server_name mysite.com www.mysite.com;
include snippets/mysitecom-redirection-rewrite;
location / {
try_files $uri $uri/ /index.php$is_args$args;
}
location ~* ^.+\.(ogg|ogv|svg|svgz|eot|otf|woff|woff2|mp4|ttf|rss|atom|jpg|jpeg|gif|png|ico|zip|rar|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf)$ {
access_log off; log_not_found off; expires max;
}
location ~ \.php$ {
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_param SCRIPT_NAME $fastcgi_script_name;
fastcgi_param REQUEST_URI $request_uri;
fastcgi_param DOCUMENT_URI $document_uri;
fastcgi_param DOCUMENT_ROOT $document_root;
fastcgi_param SERVER_PROTOCOL $server_protocol;
fastcgi_param REQUEST_SCHEME $scheme;
fastcgi_param HTTPS $https if_not_empty;
fastcgi_param GATEWAY_INTERFACE CGI/1.1;
fastcgi_param SERVER_SOFTWARE nginx/$nginx_version;
fastcgi_param REMOTE_ADDR $remote_addr;
fastcgi_param REMOTE_PORT $remote_port;
fastcgi_param SERVER_ADDR $server_addr;
fastcgi_param SERVER_PORT $server_port;
fastcgi_param SERVER_NAME $server_name;
fastcgi_param REDIRECT_STATUS 200;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
try_files $fastcgi_script_name =404;
set $path_info $fastcgi_path_info;
fastcgi_param PATH_INFO $path_info;
fastcgi_pass_header Authorization;
fastcgi_param SCRIPT_FILENAME $request_filename;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_index index.php;
fastcgi_pass unix:/var/run/php-fpm.sock;
}
location = /favicon.ico {
log_not_found off;
access_log off;
}
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
include /home/mysitecom/public_html/w3tc-nginx.conf;
access_log /var/log/nginx/access.mysitecom.log main buffer=32k;
error_log /var/log/nginx/error.mysitecom.log warn;
root /home/mysitecom/public_html;
index index.php index.html index.htm;
add_header Link "</fonts/lora-v15-latin_cyrillic-700.woff2>; as=font; rel=preload; type=font/woff2; crossorigin";
add_header Link "</wp-includes/js/jquery/jquery.js>; as=script; rel=preload; type=text/javascript";
client_max_body_size 5M;
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/local/www/nginx-dist;
}
location = /nginx.conf {
deny all;
}
}
}