-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnginx.conf
59 lines (58 loc) · 1.88 KB
/
nginx.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
####################################
# filename /etc/nginx/nginx.conf #
####################################
user www-data;
worker_processes auto;
# or: worker_processes 4;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
multi_accept on;
use epoll;
}
http {
server_names_hash_bucket_size 64;
upstream php-handler {
server unix:/run/php/php7.1-fpm.sock;
}
################################################################
# This part is optional if you have nginx build with GeoIP #
################################################################
geoip_country /usr/share/GeoIP/GeoIP.dat;
map $geoip_country_code $allowed_country {
default no;
US yes; #change to your allowed countrys
US yes;
}
geo $exclusions {
default 0;
192.168.1.1/27 1;change this to reflect your internal network
}
#################################################################
include /etc/nginx/mime.types;
limit_req_zone $binary_remote_addr zone=wp_ddos:20m rate=2r/m;
include /etc/nginx/ssl.conf;
include /etc/nginx/header.conf;
include /etc/nginx/optimization.conf;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for" '
'"$host" sn="$server_name" '
'rt=$request_time '
'ua="$upstream_addr" us="$upstream_status" '
'ut="$upstream_response_time" ul="$upstream_response_length" '
'cs=$upstream_cache_status' ;
access_log /var/log/nginx/access.log main;
sendfile on;
send_timeout 3600;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
reset_timedout_connection on;
server_tokens off;
resolver 192.168.2.1; #change to your configuration or use 8.8.8.8
resolver_timeout 10s;
include /etc/nginx/conf.d/*.conf;
}