?
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
  
user  www www;
 
worker_processes auto;
 
error_log  /var/log/nginx/error.log  warn;
 
pid        /usr/local/nginx/logs/nginx.pid;
 
#Specifies the value for maximum file descriptors that can be opened by this process.
worker_rlimit_nofile 51200;
 
events
    {
        use epoll;
        worker_connections 51200;
        multi_accept on;
    }
 
http
    {
        include       mime.types;
        default_type  application/octet-stream;
 
        log_format  json  '{"@timestamp":"$time_iso8601",'
                            '"host":"$server_addr",'
                            '"remote_addr":"$remote_addr",'
                            '"remote_user":"$remote_user",'
                            '"request":"$request",'
                            '"status":"$status",'
                            '"request_method": "$request_method",'
                            '"size":"$body_bytes_sent",'
                            '"request_time":"$request_time",'
                            '"upstreamtime":"$upstream_response_time",'
                            '"upstreamhost":"$upstream_addr",'
                            '"http_host":"$host",'
                            '"url":"$uri",'
                            '"http_forward":"$http_x_forwarded_for",'
                            '"referer":"$http_referer",'
                            '"agent":"$http_user_agent"}';
         
        access_log  /var/log/nginx/access.log  json buffer=16k;
         
        #access_log off;
 
        server_names_hash_bucket_size 128;
        client_header_buffer_size 32k;
        large_client_header_buffers 4 32k;
        client_max_body_size 50m;
 
        sendfile   on;
        tcp_nopush on;
 
        keepalive_timeout 300;
 
        tcp_nodelay on;
 
        fastcgi_connect_timeout 300;
        fastcgi_send_timeout 300;
        fastcgi_read_timeout 300;
        fastcgi_buffer_size 64k;
        fastcgi_buffers 4 64k;
        fastcgi_busy_buffers_size 128k;
        fastcgi_temp_file_write_size 256k;
 
        gzip on;
        gzip_min_length  1k;
        gzip_buffers     4 16k;
        gzip_http_version 1.1;
        gzip_comp_level 2;
        gzip_types     text/plain application/javascript application/x-javascript text/javascript text/css application/xml application/xml+rss;
        gzip_vary on;
        gzip_proxied   expired no-cache no-store private auth;
        gzip_disable   "MSIE [1-6]\.";
 
        #limit_conn_zone $binary_remote_addr zone=perip:10m;
        ##If enable limit_conn_zone,add "limit_conn perip 10;" to server section.
 
        server_tokens off;
 
server
    {
        listen 80 default_server;
        #listen [::]:80 default_server ipv6only=on;
        server_name _;
    return 403;
        index index.html index.htm index.php;
        root  /data/www/default;
 
        #error_page   404   /404.html;
 
        # Deny access to PHP files in specific directory
        #location ~ /(wp-content|uploads|wp-includes|images)/.*\.php$ { deny all; }
 
        include enable-php.conf;
 
        location /nginx_status
        {
            stub_status on;
            #access_log   off;
        }
 
        location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
    {
    expires      30d;
        }
 
        location ~ .*\.(js|css)?$
    {
    expires      12h;
        }
 
        location ~ /.well-known {
        allow all;
        }
 
        location ~ /\.
        {
            deny all;
        }
 
        #access_log  /var/log/nginx/access.log;
    }
include vhost/*.conf;
}
 
  


---------------------------------------------------------------------------------------------
不忘初心 方得始终!

唯有志存高远,方能风行天下。

道之所存,虽千万人吾往矣! 情之所钟,虽千万里吾念矣~

原创作品,允许转载,转载时请务必以超链接形式标明文章 原始出处 、作者信息和本声明。否则将追究法律责任。