# # 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_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; }