-
Notifications
You must be signed in to change notification settings - Fork 16
/
nginx.conf
71 lines (57 loc) · 1.81 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
user www-data;
worker_processes 4; # core number
#error_log /var/log/nginx/error.log debug;
error_log /var/log/nginx/error.log;
pid /var/run/nginx.pid;
events {
worker_connections 4096;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
# Logs
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;
sendfile on;
# TCP optimisation
tcp_nodelay on;
tcp_nopush on;
autoindex off;
map $scheme $fastcgi_https { ## Detect when HTTPS is used
default off;
https on;
}
# Timeout
#client_header_timeout 240;
#client_body_timeout 240;
#fastcgi_read_timeout 240;
#keepalive_timeout 3;
# Size Limits & Buffer Overflows
client_body_buffer_size 1K;
client_header_buffer_size 1k;
client_max_body_size 1M;
large_client_header_buffers 2 1k;
# Timeouts, this conf prevent php-fpm cpu overload, a little...
client_body_timeout 10;
client_header_timeout 10;
keepalive_timeout 5 5;
send_timeout 10;
# Enable keepalive in order to improve First Byte Time
keepalive_requests 10;
# Compression
gzip on;
gzip_min_length 1000;
gzip_buffers 16 8k;
gzip_comp_level 6;
gzip_types text/plain text/css application/x-javascript text/xml application/xml application/xml+rss text/javascript image/jpeg;
gzip_disable "MSIE [1-6]\.";
# Pre-compression
gzip_static on;
gzip_http_version 1.1;
gzip_proxied expired no-cache no-store private auth;
gzip_vary on;
# Load config files from the /etc/nginx/conf.d directory
include /etc/nginx/conf.d/*.conf;
}