-
Notifications
You must be signed in to change notification settings - Fork 0
/
nginx.conf
68 lines (54 loc) · 2.03 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
60
61
62
63
64
65
66
67
68
user www-data;
worker_processes auto;
pid /run/nginx.pid;
worker_rlimit_nofile 8192;
error_log /var/log/nginx/ngx.error.log warn;
events {
worker_connections 1024;
}
http {
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 30s;
client_body_timeout 20s;
client_header_timeout 20s;
send_timeout 20s;
reset_timedout_connection on;
types_hash_max_size 2048;
open_file_cache max=1000 inactive=30s;
open_file_cache_valid 30s;
open_file_cache_min_uses 2;
open_file_cache_errors on;
client_body_buffer_size 8k;
client_header_buffer_size 1k;
client_max_body_size 1k;
large_client_header_buffers 2 1k;
server_tokens off;
include mime.types;
default_type application/octet-stream;
error_page 404 /404.html;
error_page 500 501 502 503 504 /50x.html;
gzip on;
gzip_disable "msie6";
gzip_vary on;
gzip_proxied any;
gzip_comp_level 6;
gzip_buffers 16 8k;
gzip_http_version 1.1;
gzip_types text/plain text/xml text/css text/javascript text/csv application/json application/javascript application/xml application/xml+rss application/pdf application/zip image/png image/tiff image/webp image/bmp image/gif image/jpeg image/svg+xml application/x-font-ttf application/x-font-truetype application/x-font-opentype application/font-woff application/font-woff2 application/vnd.ms-fontobject application/font-sfnt;
proxy_cache_valid 5m;
proxy_cache_valid 404 1m;
limit_conn_zone $binary_remote_addr zone=conPerIp:1m;
limit_conn_zone $server_name zone=conPerServer:1m;
limit_req_zone $binary_remote_addr zone=reqPerSec1:1m rate=1r/s;
limit_req_zone $binary_remote_addr zone=reqPerSec2:1m rate=2r/s;
limit_req_zone $binary_remote_addr zone=reqPerSec3:1m rate=3r/s;
limit_req_zone $binary_remote_addr zone=reqPerSec4:1m rate=4r/s;
limit_req_zone $binary_remote_addr zone=reqPerSec5:1m rate=5r/s;
limit_req_zone $binary_remote_addr zone=reqPerSec10:1m rate=10r/s;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
include conf.d/*.conf;
include sites-enabled/*;
}