mirror of
https://github.com/mitchellkrogza/nginx-ultimate-bad-bot-blocker.git
synced 2025-09-02 18:50:13 +00:00
This example includes a modified /utilities/https_vhosts.php file which will do the includes for you on any vhosts you create using Enginetron. Please use this example ONLY as a guide.
134 lines
4.1 KiB
Nginx Configuration File
Executable file
134 lines
4.1 KiB
Nginx Configuration File
Executable file
# /**
|
|
# * @version 1.8.3
|
|
# * @package Engintron for cPanel/WHM
|
|
# * @author Fotis Evangelou
|
|
# * @url https://engintron.com
|
|
# * @copyright Copyright (c) 2010 - 2017 Nuevvo Webware P.C. All rights reserved.
|
|
# * @license GNU/GPL license: https://www.gnu.org/copyleft/gpl.html
|
|
# */
|
|
|
|
user nginx;
|
|
pid /var/run/nginx.pid;
|
|
|
|
worker_processes auto;
|
|
worker_rlimit_nofile 65535;
|
|
|
|
events {
|
|
multi_accept on;
|
|
use epoll;
|
|
worker_connections 65535;
|
|
}
|
|
|
|
http {
|
|
## Basic Settings ##
|
|
client_body_buffer_size 128k;
|
|
client_body_timeout 30s; # Use 5s for high-traffic sites
|
|
client_header_timeout 30s; # Use 5s for high-traffic sites
|
|
client_max_body_size 1024m;
|
|
keepalive_timeout 20s;
|
|
port_in_redirect off;
|
|
sendfile on;
|
|
server_name_in_redirect off;
|
|
server_tokens off;
|
|
tcp_nodelay on;
|
|
tcp_nopush on;
|
|
types_hash_max_size 2048;
|
|
|
|
## DNS Resolver ##
|
|
# If in China, enable the OpenDNS entry that matches your network connectivity (IPv4 only or IPv4 & IPv6)
|
|
# OpenDNS (IPv4 & IPv6)
|
|
#resolver 208.67.222.222 208.67.220.220 [2620:0:ccc::2] [2620:0:ccd::2];
|
|
# OpenDNS (IPv4 only)
|
|
#resolver 208.67.222.222 208.67.220.220;
|
|
# Google Public DNS (IPv4 & IPv6)
|
|
#resolver 8.8.8.8 8.8.4.4 [2001:4860:4860::8888] [2001:4860:4860::8844];
|
|
# Google Public DNS (IPv4 only) [default]
|
|
resolver 8.8.8.8 8.8.4.4;
|
|
|
|
## Real IP Forwarding ##
|
|
set_real_ip_from 127.0.0.1;
|
|
|
|
# CloudFlare IPs
|
|
# List from: https://www.cloudflare.com/ips-v4
|
|
set_real_ip_from 103.21.244.0/22;
|
|
set_real_ip_from 103.22.200.0/22;
|
|
set_real_ip_from 103.31.4.0/22;
|
|
set_real_ip_from 104.16.0.0/12;
|
|
set_real_ip_from 108.162.192.0/18;
|
|
set_real_ip_from 131.0.72.0/22;
|
|
set_real_ip_from 141.101.64.0/18;
|
|
set_real_ip_from 162.158.0.0/15;
|
|
set_real_ip_from 172.64.0.0/13;
|
|
set_real_ip_from 173.245.48.0/20;
|
|
set_real_ip_from 188.114.96.0/20;
|
|
set_real_ip_from 190.93.240.0/20;
|
|
set_real_ip_from 197.234.240.0/22;
|
|
set_real_ip_from 198.41.128.0/17;
|
|
set_real_ip_from 199.27.128.0/21;
|
|
# List from: https://www.cloudflare.com/ips-v6
|
|
set_real_ip_from 2400:cb00::/32;
|
|
set_real_ip_from 2405:8100::/32;
|
|
set_real_ip_from 2405:b500::/32;
|
|
set_real_ip_from 2606:4700::/32;
|
|
set_real_ip_from 2803:f800::/32;
|
|
set_real_ip_from 2c0f:f248::/32;
|
|
set_real_ip_from 2a06:98c0::/29;
|
|
|
|
# Replace with correct visitor IP
|
|
real_ip_header X-Forwarded-For;
|
|
real_ip_recursive on;
|
|
|
|
## MIME ##
|
|
include /etc/nginx/mime.types;
|
|
default_type application/octet-stream;
|
|
|
|
## Logging Settings ##
|
|
access_log /var/log/nginx/access.log;
|
|
error_log /var/log/nginx/error.log;
|
|
|
|
## Gzip Settings ##
|
|
gzip on;
|
|
gzip_buffers 16 8k;
|
|
gzip_comp_level 5;
|
|
gzip_disable "msie6";
|
|
gzip_min_length 256;
|
|
gzip_proxied any;
|
|
gzip_types
|
|
application/atom+xml
|
|
application/javascript
|
|
application/json
|
|
application/ld+json
|
|
application/manifest+json
|
|
application/rss+xml
|
|
application/vnd.geo+json
|
|
application/vnd.ms-fontobject
|
|
application/x-font-ttf
|
|
application/x-javascript
|
|
application/x-web-app-manifest+json
|
|
application/xhtml+xml
|
|
application/xml
|
|
font/opentype
|
|
image/bmp
|
|
image/svg+xml
|
|
image/x-icon
|
|
text/cache-manifest
|
|
text/css
|
|
text/javascript
|
|
text/plain
|
|
text/vcard
|
|
text/vnd.rim.location.xloc
|
|
text/vtt
|
|
text/x-component
|
|
text/x-cross-domain-policy
|
|
text/x-js
|
|
text/xml;
|
|
gzip_vary on;
|
|
|
|
# Proxy Settings
|
|
proxy_cache_path /tmp/engintron_dynamic levels=1:2 keys_zone=engintron_dynamic:20m inactive=10m max_size=500m;
|
|
proxy_cache_path /tmp/engintron_static levels=1:2 keys_zone=engintron_static:20m inactive=10m max_size=500m;
|
|
proxy_temp_path /tmp/engintron_temp;
|
|
|
|
## Virtual Host Configs ##
|
|
include /etc/nginx/conf.d/*.conf;
|
|
}
|