-
Notifications
You must be signed in to change notification settings - Fork 7
/
nginx.conf
74 lines (63 loc) · 2.68 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
worker_processes 2;
pid /var/run/nginx.pid;
# [ debug | info | notice | warn | error | crit ]
error_log /var/log/nginx.error_log info;
events {
worker_connections 2000;
use epoll;
}
http {
include /etc/nginx/mime.types;
##
# LOG
##
# Log format. Other NGINX variables ($variable) can be used as you wish.
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: path and type.
access_log dnginx_access.log main;
# Error log: path and type.
error_log /var/log/nginx_error.log debug;
##
# TCP
##
# Optimizes data transfer copying data between one file descriptor and another
# instead of reading and copying data to/from user space.
sendfile on;
# Causes NGINX to attempt to send its HTTP response head in one packet,
# instead of using partial frames. This is useful for prepending headers before calling sendfile,
# or for throughput optimization.
tcp_nopush on;
# Disables the Nagle algorithm.
# It's useful for sending frequent small bursts of data in real time.
tcp_nodelay off;
# Timeout during which a keep-alive client connection will stay open to serve
# all the requested files from the server side.
keepalive_timeout 30s;
# If a client does not receive anything within the time set in this directive, a connection is closed.
send_timeout 60s;
##
# GZIP
##
# In production you MUST set gzip to "on" in order to save bandwidth. Web browsers
# which handle compressed files (all recent ones do) will get a very smaller version
# of the server response.
gzip on;
# Enables compression for a given HTTP request version.
gzip_http_version 1.0;
# Compression level 1 (fastest) to 9 (slowest).
gzip_comp_level 6;
# Enables compression for all proxied requests.
gzip_proxied any;
# Minimum length of the response (bytes). Responses shorter than this length will not be compressed.
gzip_min_length 10000;
# Enables compression for additional MIME-types.
gzip_types text/plain text/css application/x-javascript text/xml
application/xml application/xml+rss text/javascript;
# Disables gzip compression for User-Agents matching the given regular expression.
# Is this case we've disabled gzip for old versions of the IE that don't support compressed responses.
gzip_disable "MSIE [1-6] \.";
# Load modular configuration files from the /etc/nginx/conf.d directory.
include /etc/nginx/conf.d/*.conf;
}