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 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201
| http { include 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 access_json '{"@timestamp":"$time_iso8601",' '"host":"$server_addr",' '"clientip":"$remote_addr",' '"size":$body_bytes_sent,' '"responsetime":$request_time,' '"upstreamtime":"$upstream_response_time",' '"upstreamhost":"$upstream_addr",' '"http_host":"$host",' '"uri":"$uri",' '"domain":"$host",' '"xff":"$http_x_forwarded_for",' '"referer":"$http_referer",' '"tcp_xff":"$proxy_protocol_addr",' '"http_user_agent":"$http_user_agent",' '"status":"$status"}'; access_log logs/access.log access_json; sendfile on; directio 4m; tcp_nopush off; aio on; keepalive_timeout 65 65; keepalive_requests 2000; tcp_nodelay off; keepalive_disable msie6;
gzip on; gzip_comp_level 5; gzip_disable "MSIE [1-6]\."; gzip_http_version 1.0; gzip_min_length 1k; gzip_types text/plain application/json application/javascript application/x-javascript text/cssapplication/xml text/javascript application/x-httpd-php image/jpeg image/gif image/png; gzip_vary on; client_max_body_size 1024m; client_body_buffer_size 16k; client_body_temp_path /apps/nginx/client_body_temp 1 2 2; open_file_cache max=10000 inactive=60s; open_file_cache_valid 60s; open_file_cache_min_uses 5; open_file_cache_errors on; add_header X-cache $upstream_cache_status; add_header X-Via MageEdu; server_tokens off;
proxy_http_version 1.0; proxy_connect_timeout 60s; proxy_read_timeout 60s; proxy_send_timeout 60s; proxy_set_header X-Forwarded-For $remote_addr; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $host; proxy_headers_hash_bucket_size 128; proxy_headers_hash_max_size 512; server_names_hash_bucket_size 512; server_names_hash_max_size 512; proxy_ignore_client_abort off;
proxy_cache_key $request_uri; proxy_cache_valid 200 302 301 10m; proxy_cache_valid any 1m; proxy_cache_path /apps/nginx/cache/proxy_temp levels=1:2:2 keys_zone=proxycache:20m inactive=120s max_size=1g; fastcgi_cache_key $request_uri; fastcgi_cache_path /apps/nginx/cache/fastcgi_temp levels=1:2:2 keys_zone=fastcgicache:20m inactive=120s max_size=1g; fastcgi_cache_valid 200 302 301 10m; fastcgi_cache_valid any 1m; include conf.d/*.conf; }
|