2 # Copyright (C) 2017-2018 ZTE, Inc. and others. All rights reserved. (ZTE)
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
8 # http://www.apache.org/licenses/LICENSE-2.0
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
17 #the maximum allowed size of the client request body,current 10G
18 client_max_body_size 10240m;
19 client_body_buffer_size 128k;
21 #set conf for proxy pass
22 proxy_connect_timeout 5s;
23 proxy_read_timeout 1200s;
24 proxy_send_timeout 1200s;
25 proxy_set_header X-Real-IP $remote_addr;
26 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
27 proxy_set_header Host $host:$server_port;
29 proxy_http_version 1.1;
30 proxy_set_header Connection "";
32 #set the nginx_cache parameter
33 proxy_cache_path temp/proxy_cache levels=1:2 keys_zone=nginx_cache:100m inactive=1d max_size=1g;
34 proxy_cache_key $host$uri$is_args$args;
35 proxy_cache_revalidate on;
36 proxy_cache_min_uses 3;
37 proxy_cache_use_stale error timeout updating http_500 http_502 http_503 http_504;
40 proxy_next_upstream error timeout;
41 proxy_next_upstream_tries 5;
44 lua_package_path "$prefix/../lualib/?.lua;$prefix/luaext/?.lua;$prefix/luaext/vendor/?.lua;;";
45 lua_package_cpath "$prefix/../lualib/?.so;;";
46 #lua_shared_dict rr_cache 1M;
47 #lua_shared_dict rr_locks 100k;
49 lua_shared_dict svc_cache 5M;
50 lua_shared_dict locks 200k;
51 lua_shared_dict stats 1M;
52 lua_shared_dict dns_cache 1M;
56 # Basic reverse proxy server processor
57 upstream defaultbackend {
59 balancer_by_lua_file luaext/loadbalance/balancer.lua;
65 stats = require ('monitor.stats')
67 init_worker_by_lua_block {
72 include ../msb-enabled/location-default/msblocations.conf;