Divide the MSB source codes into two repos
[msb/apigateway.git] / openresty-ext / src / assembly / resources / openresty / nginx / msb-enabled / msb.conf
1 #
2 # Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE)
3 #
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
7 #
8 #         http://www.apache.org/licenses/LICENSE-2.0
9 #
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.
15 #
16
17 #the maximum allowed size of the client request body,current 10G
18 client_max_body_size 10240m; 
19 client_body_buffer_size 128k;
20         
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;
28 proxy_buffers 4 16k;
29 proxy_http_version 1.1;
30 proxy_set_header Connection "";
31
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;
38 proxy_cache_lock on;
39
40 proxy_next_upstream error timeout;
41 proxy_next_upstream_tries 5;
42
43 # Lua settings
44 lua_package_path "$prefix/../lualib/?.lua;$prefix/luaext/?.lua;;";
45 lua_package_cpath "$prefix/../lualib/?.so;;";
46 #lua_shared_dict rr_cache 1M;
47 #lua_shared_dict rr_locks 100k;
48
49 lua_shared_dict svc_cache 5M;
50 lua_shared_dict locks 200k;
51
52 lua_code_cache on;
53
54 # Basic reverse proxy server processor
55 upstream defaultbackend {
56         server 0.0.0.1;
57         balancer_by_lua_file luaext/loadbalance/balancer.lua;
58         keepalive 300;
59 }
60 init_by_lua_block {
61         msb = require('msb')
62         msb.load_plugins()
63 }
64 server {
65         listen 80;
66         include ../msb-enabled/location-default/msblocations.conf;
67 }