2 # Copyright 2016 2015-2016 ZTE, Inc. and others. All rights reserved.
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
8 # http://www.apache.org/licenses/LICENSE-2.0
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.
16 # Author: Zhaoxing Meng
17 # email: meng.zhaoxing1@zte.com.cn
22 default_type text/html;
23 add_header X-Cache-Status $upstream_cache_status;
26 rewrite ^ /openoui/microservices/index.html redirect;
29 location = /openoui/microservices {
30 rewrite /openoui/microservices /openoui/microservices/index.html redirect;
34 set $server "fallback";
39 rewrite_by_lua_file luaext/customrouter.lua;
40 access_by_lua_file luaext/execute_auth.lua;
42 proxy_pass http://$server;
44 location ~ ^/api/(.*) {
45 rewrite ^/api/(.*) /openoapi/$1 last;
47 location ~ ^/iui/(.*) {
48 rewrite ^/iui/(.*) /openoui/$1 last;
51 location ^~ /openoapi/driver_vmware_vcloud/v1 {
55 local driver_manager = require('plugins.driver_manager')
56 driver_manager.access()
58 proxy_pass http://$backend;
60 location ~ ^/openoapi/([^/]+)(/[Vv][^/]*)?(.*) {
63 set $apiserver "fallback";
67 rewrite_by_lua_file luaext/openoapirouter.lua;
68 access_by_lua_file luaext/execute_auth.lua;
70 proxy_pass http://$apiserver;
73 location ~ ^/openoui/([^/]+)(.*) {
74 location ~* ^/iui/([^/]+)(.*)\.(?:png|jpg|jpeg|js|css|html|gif|ico|bmp|woff)$ {
77 set $iuiserver "fallback";
81 rewrite_by_lua_file luaext/openouirouter.lua;
82 access_by_lua_file luaext/execute_auth.lua;
84 proxy_cache nginx_cache;
85 proxy_cache_key $host$uri$is_args$args;
86 proxy_cache_valid 200 304 12h ;
87 proxy_cache_valid 301 302 1m ;
88 proxy_cache_valid any 1m ;
91 proxy_pass http://$iuiserver;
95 set $iuiserver "fallback";
99 rewrite_by_lua_file luaext/openouirouter.lua;
100 access_by_lua_file luaext/execute_auth.lua;
102 proxy_pass http://$iuiserver;
105 location ~ ^/admin/([^/]+)(/[Vv][^/]*)?(.*) {
108 set $apiserver "fallback";
112 rewrite_by_lua_file luaext/openoadminrouter.lua;
113 access_by_lua_file luaext/execute_auth.lua;
115 proxy_pass http://$apiserver;
118 location ~ ^/apijson/([^/]+)(/[Vv][^/]*)?(.*) {
119 location ~* ^/apijson/([^/]+)(/[v][^/]*)?(.*)\.(?:png|jpg|jpeg|js|css|html|gif|ico|bmp|woff)$ {
122 set $apiserver "fallback";
126 rewrite_by_lua_file luaext/openoapijsonrouter.lua;
127 access_by_lua_file luaext/execute_auth.lua;
129 proxy_cache nginx_cache;
130 proxy_cache_key $host$uri$is_args$args;
131 proxy_cache_valid 200 304 12h ;
132 proxy_cache_valid 301 302 1m ;
133 proxy_cache_valid any 1m ;
136 proxy_pass http://$apiserver;
140 set $apiserver "fallback";
144 rewrite_by_lua_file luaext/openoapijsonrouter.lua;
145 access_by_lua_file luaext/execute_auth.lua;
147 proxy_pass http://$apiserver;
150 location ~* \.(?:png|jpg|jpeg|js|css|html|gif|ico|bmp|woff)$ {
151 set $server "fallback";
156 rewrite_by_lua_file luaext/customrouter.lua;
157 access_by_lua_file luaext/execute_auth.lua;
159 proxy_cache nginx_cache;
160 proxy_cache_key $host$uri$is_args$args;
161 proxy_cache_valid 200 304 12h ;
162 proxy_cache_valid 301 302 1m ;
163 proxy_cache_valid any 1m ;
166 proxy_pass http://$server;
169 location = /favicon.ico {