-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnginx.conf
More file actions
80 lines (63 loc) · 2.7 KB
/
nginx.conf
File metadata and controls
80 lines (63 loc) · 2.7 KB
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
user nginx;
worker_processes 1;
error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;
env DOCKER_NGINX_VHOST_DIR;
env DOCKER_NGINX_CA_DIR;
env WWWROOT_DIR;
env LOCAL_DIR;
events {
worker_connections 1024;
}
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
log_format Fluentd '{ "env_timestamp": "$time_iso8601", '
'"remote_addr": "$remote_addr", '
'"remote_user": "$remote_user", '
'"body_bytes_sent": "$body_bytes_sent", '
'"request_time": "$request_time", '
'"server_protocol": "$server_protocol", '
'"status": "$status", '
'"http_host": "$http_host", '
'"request_uri": "$request_uri", '
'"pid": "$pid", '
'"request_filename": "$request_filename", '
'"upstream_addr": "$upstream_addr",'
'"upstream_response_time": "$upstream_response_time",'
'"request_method": "$request_method", '
'"http_referrer": "$http_referer", '
'"http_x_forwarded_for": "$http_x_forwarded_for", '
'"nginx_cache_status": "$upstream_cache_status", '
'"http_user_agent": "$http_user_agent" }';
# 默认编码
charset utf-8;
sendfile on;
# tcp_nopush on;
keepalive_timeout 65;
gzip on;
gzip_vary on;
gzip_comp_level 6;
gzip_buffers 16 8k;
gzip_min_length 1000;
gzip_proxied any;
gzip_http_version 1.0;
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript image/svg+xml;
brotli on;
brotli_comp_level 6;
brotli_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript image/svg+xml;
server_tokens off;
# 修改 Nginx 默认 root ,因为 html/ 是正存在的目录
root /etc/nginx/403;
server {
listen 80 default;
# 上报日志
access_log syslog:server=kibana-fluentd:8989,tag=default Fluentd;
error_log syslog:server=kibana-fluentd:8988,tag=default error;
return 403;
}
include vhost/*.conf;
}