-
Notifications
You must be signed in to change notification settings - Fork 33
/
Copy pathnginx.conf
52 lines (45 loc) · 1.34 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
user www-data;
# Set this parameters to the number of CPU core
# cat /proc/cpuinfo | grep processor | wc -l
worker_processes 1;
worker_rlimit_nofile 8192;
events {
# max_clients = worker_processes * worker_connections
worker_connections 1024;
# Only for Linux 2.6 or >
use epoll;
# Accept as many connections as possible
multi_accept on;
}
http {
include mime.types;
default_type application/octet-stream;
# Hide the Nginx version number
server_tokens off;
# Tweeks
sendfile on;
tcp_nodelay on;
tcp_nopush off;
keepalive_timeout 65;
client_body_timeout 30;
client_header_timeout 30;
send_timeout 30;
client_max_body_size 8M;
reset_timedout_connection on;
# Log
set_real_ip_from 127.0.0.1;
real_ip_header X-Forwarded-For;
log_format main '$remote_addr - $remote_user [$time_local] $status '
'"$request" $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
# GZip module
gzip on;
gzip_disable "MSIE [1-6].(?!.*SV1)";
gzip_vary on;
gzip_comp_level 3;
gzip_proxied any;
gzip_buffers 16 8k;
gzip_types text/css text/javascript;
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}