Enable headers with _
[msb/apigateway.git] / openresty-ext / src / assembly / resources / openresty / nginx / msb-enabled / msb.conf
index 8e854bb..8ed1077 100644 (file)
@@ -1,5 +1,5 @@
 #
-# Copyright (C) 2016 ZTE, Inc. and others. All rights reserved. (ZTE)
+# 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.
@@ -15,9 +15,9 @@
 #
 
 #the maximum allowed size of the client request body,current 10G
-client_max_body_size 10240m; 
+client_max_body_size 10240m;
 client_body_buffer_size 128k;
-       
+
 #set conf for proxy pass
 proxy_connect_timeout 5s;
 proxy_read_timeout 1200s;
@@ -25,6 +25,7 @@ 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 "";
@@ -41,13 +42,15 @@ proxy_next_upstream error timeout;
 proxy_next_upstream_tries 5;
 
 # Lua settings
-lua_package_path "$prefix/../lualib/?.lua;$prefix/luaext/?.lua;;";
+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;
 
@@ -60,8 +63,14 @@ upstream defaultbackend {
 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;
-}
\ No newline at end of file
+        # Add below settings for making SDC to work
+        underscores_in_headers on;
+}