-
Notifications
You must be signed in to change notification settings - Fork 0
/
nginx.conf
106 lines (86 loc) · 2.69 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
pid /tmp/nginx.pid;
worker_processes auto;
events {
multi_accept on;
accept_mutex on;
worker_connections 1024;
}
http {
client_body_temp_path /tmp/client_temp;
proxy_temp_path /tmp/proxy_temp_path;
include /etc/nginx/mime.types;
uwsgi_temp_path /tmp/uwsgi_temp;
scgi_temp_path /tmp/scgi_temp;
proxy_ignore_client_abort on;
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;
ssi on;
#tcp_nopush on;
keepalive_timeout 5;
keepalive_requests 100;
types_hash_max_size 2048;
server_tokens off;
client_body_timeout 10;
reset_timedout_connection on;
send_timeout 2;
# Задание буфера для заголовка и тела запроса
client_header_buffer_size 2k;
client_body_buffer_size 256k;
# Ограничение на размер тела запроса
client_max_body_size 12m;
sendfile on;
aio threads;
directio 8m;
tcp_nodelay on;
tcp_nopush on;
# SSL Settings
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_ciphers ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-RSA-AES256-SHA384;
# Optimize session cache
ssl_session_cache shared:SSL:100m;
ssl_session_timeout 1h;
# Enable session tickets
ssl_session_tickets on;
# OCSP Stapling
ssl_stapling on;
ssl_stapling_verify on;
resolver 8.8.8.8 8.8.4.4 208.67.222.222 208.67.220.220 valid=60s;
resolver_timeout 2s;
server {
add_header X-Cache $upstream_cache_status;
gzip on;
gzip_comp_level 9;
gzip_min_length 512;
gzip_buffers 8 64k;
gzip_types text/css text/plain application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript image/svg+xml;
gzip_proxied any;
listen 80;
server_name _;
root /usr/share/nginx/html;
location ~* .(ico|jpg|png|gif|jpeg|css|swf|js|woff)$ {
access_log off;
gzip_static on;
gzip_comp_level 5;
expires 1M;
add_header Cache-Control private;
# add_header Cache-Control public;
}
location ~* ^.+.(ogg|woff2|ogv|svg|svgz|otf|woff|mp4|ttf|rss|atom|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf)$ {
access_log off;
log_not_found off;
expires max;
}
location ~* ^.+.(css|js)$ {
access_log off;
log_not_found off;
expires 10m;
}
location / {
#autoindex on;
try_files $uri $uri/ /index.html;
}
}
}