aboutsummaryrefslogtreecommitdiffstats
path: root/msb-core/openresty-ext/src/assembly/resources/openresty/nginx/conf/nginx.conf
blob: 9a2db3fefa933f3e817eced40d8d1d2253d2338b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
#user xfs xfs;
worker_processes 1;

error_log logs/error.log warn;
pid logs/nginx.pid;

events {
    worker_connections 1024;
}

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;
    tcp_nopush     on;
    server_names_hash_bucket_size 128;  
    keepalive_timeout  120s;
	
	#the maximum allowed size of the client request body,current 10G
	client_max_body_size 10240m; 
    client_body_buffer_size 128k;
	
	#set the time wait for connect to proxy_pass target,avoid waiting too long
	proxy_connect_timeout 10s;
	proxy_read_timeout 120s;
	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_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;
	
    # 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;
		}

		location /api/odlsdnia/v1 {
			access_by_lua_file luaext/auth.lua;
			proxy_pass http://odlsdn;
		}
    }	
}