blob: 8ed1077f9c4df04ca6a73f66e41f28c718e6256c (
plain)
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
|
#
# Copyright (C) 2017-2018 ZTE, Inc. and others. All rights reserved. (ZTE)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
#the maximum allowed size of the client request body,current 10G
client_max_body_size 10240m;
client_body_buffer_size 128k;
#set conf for proxy pass
proxy_connect_timeout 5s;
proxy_read_timeout 1200s;
proxy_send_timeout 1200s;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host:$server_port;
#proxy_set_header Host $svc_name;
proxy_buffers 4 16k;
proxy_http_version 1.1;
proxy_set_header Connection "";
#set the nginx_cache parameter
proxy_cache_path temp/proxy_cache levels=1:2 keys_zone=nginx_cache:100m inactive=1d max_size=1g;
proxy_cache_key $host$uri$is_args$args;
proxy_cache_revalidate on;
proxy_cache_min_uses 3;
proxy_cache_use_stale error timeout updating http_500 http_502 http_503 http_504;
proxy_cache_lock on;
proxy_next_upstream error timeout;
proxy_next_upstream_tries 5;
# Lua settings
lua_package_path "$prefix/../lualib/?.lua;$prefix/luaext/?.lua;$prefix/luaext/vendor/?.lua;;";
lua_package_cpath "$prefix/../lualib/?.so;;";
#lua_shared_dict rr_cache 1M;
#lua_shared_dict rr_locks 100k;
lua_shared_dict svc_cache 5M;
lua_shared_dict locks 200k;
lua_shared_dict stats 1M;
lua_shared_dict dns_cache 1M;
lua_code_cache on;
# Basic reverse proxy server processor
upstream defaultbackend {
server 0.0.0.1;
balancer_by_lua_file luaext/loadbalance/balancer.lua;
keepalive 300;
}
init_by_lua_block {
msb = require('msb')
msb.load_plugins()
stats = require ('monitor.stats')
}
init_worker_by_lua_block {
stats.init_timer()
}
server {
listen 80;
include ../msb-enabled/location-default/msblocations.conf;
# Add below settings for making SDC to work
underscores_in_headers on;
}
|