-
-
Notifications
You must be signed in to change notification settings - Fork 45
/
Copy pathnginx.conf
59 lines (44 loc) · 1.43 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
# user www-data;
pid /tmp/nginx.pid;
worker_processes auto;
events {
worker_connections 1024;
}
http {
charset utf-8;
# copies data between one FD and other from within the kernel
# faster than read() + write()
sendfile on;
# send headers in one piece, it is better than sending them one by one
tcp_nopush on;
# don't buffer data sent, good for small data bursts in real time
tcp_nodelay on;
# allow the server to close connection on non responding client, this will free up memory
reset_timedout_connection on;
# hide server info for security
server_tokens off;
log_not_found off;
types_hash_max_size 2048;
# if the request body size is more than the buffer size, then the entire (or partial)
# request body is written into a temporary file
client_body_buffer_size 128k;
# maximum body size
client_max_body_size 16M;
# maximum number and size of buffers for large headers to read from client request
large_client_header_buffers 4 256k;
# cache information about FDs, frequently accessed files
open_file_cache max=200000 inactive=20s;
open_file_cache_valid 60s;
open_file_cache_min_uses 5;
open_file_cache_errors off;
# MIME
include mime.types;
default_type application/octet-stream;
# enhancment
# Replace loadbalancer IP(real-ip) with actual client IP.
set_real_ip_from 0.0.0.0/0;
real_ip_header X-Forwarded-For;
real_ip_recursive on;
# load configs
include /etc/nginx/conf.d/*.conf;
}