3 Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE)
5 Licensed under the Apache License, Version 2.0 (the "License");
6 you may not use this file except in compliance with the License.
7 You may obtain a copy of the License at
9 http://www.apache.org/licenses/LICENSE-2.0
11 Unless required by applicable law or agreed to in writing, software
12 distributed under the License is distributed on an "AS IS" BASIS,
13 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 See the License for the specific language governing permissions and
15 limitations under the License.
19 local modulename = "msbinit"
23 local str_util = require('lib.utils.str_util')
24 local mark_empty_as_nil = str_util.mark_empty_as_nil
27 ["defaultport"] = mark_empty_as_nil(os.getenv("HTTP_OVERWRITE_PORT")) or "80",
28 ["defaulthttpsport"] = mark_empty_as_nil(os.getenv("HTTPS_OVERWRITE_PORT")) or "443",
29 ["defaultprefix"] = "msb:routing",
30 ["enablefullsearch"] = true, --whether test against the custom services after common match processing
31 ["enablerefercheck"] = true, --whether use refer to test against the service names as the last solution
32 ["useconsultemplate"] = true --whether using consul template or not
35 ["host"] = "127.0.0.1",
38 ["idletimeout"] = 90000,
43 ["positive_ttl"] = 5, --shcache use,in seconds
44 ["negative_ttl"] = 2, --shcache use,in seconds
45 ["actualize_ttl"] = 120, --shcache use,in seconds
46 ["lru_ttl"] = 2 --in seconds
49 -- cross-domain plugin uses this field in init_by_lua context, ngx.re.gsub is not allowed in this context, using string.gsub instead
50 --["subdomain"] = ngx.re.gsub(os.getenv("ROUTER_SBUDOMAIN") or "openpalette.zte.com.cn", "\\.", "\\.", "o"),
51 ["subdomain"] = string.gsub(mark_empty_as_nil(os.getenv("ROUTER_SUBDOMAIN")) or "openpalette.zte.com.cn", "%.", "\\."),
52 ["defaultprefix"]= "msb:host"
55 ["fail_timeout"] = 10,