diff options
author | 2016-09-08 23:20:06 +0800 | |
---|---|---|
committer | 2016-09-09 14:18:38 +0800 | |
commit | b69d850757a7a8c4ff9a368df004a3cfaaf9f1e4 (patch) | |
tree | 6ba5fb3330c763fd3d550ec3671f723587beae65 /msb-core/openresty-ext/src/assembly/resources/openresty/nginx/conf/nginx.conf | |
parent | 3be6b09b74dd3e54e631181dc37bd1e5685a1c62 (diff) |
Issue-id: OCS-9
Change-Id: I73c18bdda656c43687810930338f9a949ed08848
Signed-off-by: Zhaoxing <meng.zhaoxing1@zte.com.cn>
Diffstat (limited to 'msb-core/openresty-ext/src/assembly/resources/openresty/nginx/conf/nginx.conf')
-rw-r--r-- | msb-core/openresty-ext/src/assembly/resources/openresty/nginx/conf/nginx.conf | 212 |
1 files changed, 28 insertions, 184 deletions
diff --git a/msb-core/openresty-ext/src/assembly/resources/openresty/nginx/conf/nginx.conf b/msb-core/openresty-ext/src/assembly/resources/openresty/nginx/conf/nginx.conf index 9a2db3f..c5dc770 100644 --- a/msb-core/openresty-ext/src/assembly/resources/openresty/nginx/conf/nginx.conf +++ b/msb-core/openresty-ext/src/assembly/resources/openresty/nginx/conf/nginx.conf @@ -1,3 +1,22 @@ +# +# Copyright 2016 2015-2016 ZTE, Inc. and others. All rights reserved. +# +# 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. +# +# Author: Zhaoxing Meng +# email: meng.zhaoxing1@zte.com.cn +# + #user xfs xfs; worker_processes 1; @@ -9,64 +28,6 @@ events { } http { - include mime.types; - - upstream iui { - server 127.0.0.1:8202; - } - - upstream nsoc { - server 127.0.0.1:8203; - } - - upstream roc { - server 127.0.0.1:8204; - } - - upstream umc { - server 127.0.0.1:8205; - } - - upstream ssh { - server 127.0.0.1:8209; - } - - upstream yamlparser { - server 127.0.0.1:8210; - } - - upstream dac { - server 127.0.0.1:8206; - } - - upstream cmcc { - server 127.0.0.1:8207; - } - - upstream tacker { - server 127.0.0.1:8208; - } - - upstream winery { - server 127.0.0.1:8080; - } - - upstream etsi { - server 127.0.0.1:8211; - } - - upstream openstackadapter { - server 127.0.0.1:8217; - } - - upstream vimadapter { - server 127.0.0.1:8218; - } - - upstream odlsdn { - server 127.0.0.1:8216; - } - # Basic Settings default_type application/octet-stream; sendfile on; @@ -84,144 +45,27 @@ http { proxy_send_timeout 120s; 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 $host; proxy_buffers 4 32k; #set the nginx_cache parameter - #proxy_cache_path temp/proxy_cache levels=1:2 keys_zone=nginx_cache:10m inactive=1d max_size=100m; + proxy_cache_path temp/proxy_cache levels=1:2 keys_zone=nginx_cache:1024m inactive=1d max_size=10g; # Logging access_log off; # Lua settings lua_package_path "$prefix/../lualib/?.lua;;"; - lua_package_cpath "$prefix/../lualib/?.so;;"; lua_shared_dict ceryx 10M; lua_code_cache on; - - server { - listen 80; - default_type text/html; - - location = / { - rewrite ^ /iui/framework redirect; - } - - location = /openo { - rewrite ^ /iui/framework redirect; - } - - location = /iui/openo { - rewrite ^ /iui/framework redirect; - } - - location = /iui/framework/login.html { - access_by_lua_file luaext/iui_auth.lua; - proxy_pass http://iui; - } - - location = /api/uiframe/v1/login { - rewrite ^ /api/umcsm/v1/login break; - proxy_pass http://umc; - header_filter_by_lua_file luaext/login.lua; - } - - location = /api/uiframe/v1/loginOut { - access_by_lua_file luaext/logout.lua; - rewrite ^ /api/umcsm/v1/loginOut break; - proxy_pass http://umc; - } - - location = /api/hsif/v1/authentication { - access_by_lua_file luaext/make_authed.lua; - } - - location /iui { - access_by_lua_file luaext/iui_auth.lua; - proxy_pass http://iui; - } - - location ~ ^/api/(?:vim|nsoc)/v1 { - access_by_lua_file luaext/auth.lua; - proxy_pass http://nsoc; - } - - location = /api/nsoc/v1/vnfgrantinfo { - rewrite ^ /api/vim/v1/vnfgrantinfo break; - access_by_lua_file luaext/auth.lua; - proxy_pass http://nsoc; - } - - location /api/nsocnotification/v1 { - rewrite ^/api/nsocnotification/v1/(.*) /nsocnotification/v1/$1 break; - access_by_lua_file luaext/auth.lua; - proxy_pass http://nsoc; - } - - location ~ ^/api/(?:roc|rocnotification)/v1 { - access_by_lua_file luaext/auth.lua; - proxy_pass http://roc; - } - - location /api/uiframe/v1 { - rewrite ^/api/uiframe/v1/(.*) /api/umcsm/v1/$1 break; - access_by_lua_file luaext/iui_auth.lua; - proxy_pass http://umc; - } - - location ~ ^/api/umc(?:pm|fm|drill|sm|monitor)/v1 { - access_by_lua_file luaext/auth.lua; - proxy_pass http://umc; - } - - location ~ ^/api/ssh/v1 { - proxy_pass http://ssh; - } - - location ~ ^/api/yamlparser/v1 { - proxy_pass http://yamlparser; - } - - location ~ ^/api/(?:dac|dacnotification)/v1 { - access_by_lua_file luaext/auth.lua; - proxy_pass http://dac; - } - - location /api/cmccia/v1 { - access_by_lua_file luaext/auth.lua; - proxy_pass http://cmcc; - } - - location /api/tackeria/v1 { - access_by_lua_file luaext/auth.lua; - proxy_pass http://tacker; - } - location /winery { - access_by_lua_file luaext/auth.lua; - proxy_pass http://winery; - } - - location = /api/microservices/v1/apiRoute { - access_by_lua_file luaext/auth.lua; - content_by_lua_file luaext/serviceaccess.lua; - } - - location /api/umcswagger/v1 { - rewrite ^/api/umcswagger/v1/(.*) /api/$1 break; - access_by_lua_file luaext/auth.lua; - proxy_pass http://umc; - } - - location /api/etsiia/v1 { - access_by_lua_file luaext/auth.lua; - proxy_pass http://etsi; - } + # see https://github.com/openresty/lua-resty-core + #init_by_lua ' + # require "resty.core" + #'; - location /api/odlsdnia/v1 { - access_by_lua_file luaext/auth.lua; - proxy_pass http://odlsdn; - } - } + # Includes + include mime.types; + include ../sites-enabled/*.conf; } |