[MSB]Support TLSv1.3
[msb/apigateway.git] / openresty-ext / src / assembly / resources / openresty / nginx / msb-enabled / msb.conf
1 #
2 # Copyright (C) 2017-2018 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 ssl_prefer_server_ciphers on;
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_set_header Host $svc_name;
29 proxy_buffers 4 16k;
30 proxy_http_version 1.1;
31 proxy_set_header Connection "";
32
33 #set the nginx_cache parameter
34 proxy_cache_path  temp/proxy_cache  levels=1:2   keys_zone=nginx_cache:100m inactive=1d max_size=1g;
35 proxy_cache_key $host$uri$is_args$args;
36 proxy_cache_revalidate on;
37 proxy_cache_min_uses 3;
38 proxy_cache_use_stale error timeout updating http_500 http_502 http_503 http_504;
39 proxy_cache_lock on;
40
41 proxy_next_upstream error timeout;
42 proxy_next_upstream_tries 5;
43
44 # Lua settings
45 lua_package_path "$prefix/../lualib/?.lua;$prefix/luaext/?.lua;$prefix/luaext/vendor/?.lua;;";
46 lua_package_cpath "$prefix/../lualib/?.so;;";
47 #lua_shared_dict rr_cache 1M;
48 #lua_shared_dict rr_locks 100k;
49
50 lua_shared_dict svc_cache 5M;
51 lua_shared_dict locks 200k;
52 lua_shared_dict stats 1M;
53 lua_shared_dict dns_cache 1M;
54
55 lua_code_cache on;
56
57 # Basic reverse proxy server processor
58 upstream defaultbackend {
59         server 0.0.0.1;
60         balancer_by_lua_file luaext/loadbalance/balancer.lua;
61         keepalive 300;
62 }
63 init_by_lua_block {
64         msb = require('msb')
65         msb.load_plugins()
66         stats = require ('monitor.stats')
67 }
68 init_worker_by_lua_block {
69         stats.init_timer()
70 }
71 server {
72         listen 80;
73         include ../msb-enabled/location-default/msblocations.conf;
74         # Add below settings for making SDC to work
75         underscores_in_headers on;
76 }