diff options
author | HuabingZhao <zhao.huabing@zte.com.cn> | 2017-07-04 05:15:15 +0000 |
---|---|---|
committer | HuabingZhao <zhao.huabing@zte.com.cn> | 2017-07-04 05:51:17 +0000 |
commit | 5353f7df61d16d6624ba033627a7d09160fb679c (patch) | |
tree | c5dd805b7c1655589a0edaf0a6a7d54e78fec539 /nginx-ext-consul/src/assembly/resources/nginx/sites-enabled/openresty-consul.conf | |
parent | a3fa8cc2c6fa2883bc88a8244cbce5cacfd4fadf (diff) |
migrate discovery source codes from OPEN-O
Change-Id: I65396f0ed5f85542e8b17b509fc30073bf7f959e
Signed-off-by: HuabingZhao <zhao.huabing@zte.com.cn>
Diffstat (limited to 'nginx-ext-consul/src/assembly/resources/nginx/sites-enabled/openresty-consul.conf')
-rw-r--r-- | nginx-ext-consul/src/assembly/resources/nginx/sites-enabled/openresty-consul.conf | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/nginx-ext-consul/src/assembly/resources/nginx/sites-enabled/openresty-consul.conf b/nginx-ext-consul/src/assembly/resources/nginx/sites-enabled/openresty-consul.conf new file mode 100644 index 0000000..f4f19ab --- /dev/null +++ b/nginx-ext-consul/src/assembly/resources/nginx/sites-enabled/openresty-consul.conf @@ -0,0 +1,66 @@ +#set conf for proxy pass +proxy_connect_timeout 15s; +proxy_read_timeout 360s; +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_http_version 1.1; +proxy_set_header Connection ""; + +upstream apibackend { + server 127.0.0.1:8076; + keepalive 200; +} +upstream consulbackend { + server 127.0.0.1:8500; + keepalive 200; +} + + +server { + listen 10081; + + location /api/microservices/v1 { + proxy_pass http://apibackend; + } + location /iui/microservices { + root html ; + } + + location /admin/metrics { + proxy_pass http://apibackend; + } + + location /api/msdiscover/v1 { + rewrite ^/api/msdiscover/v1/(.*) /api/microservices/v1/$1 break; + proxy_pass http://apibackend; + } + + location /api/catalog/v1 { + rewrite ^/api/catalog/v1/(.*) /v1/catalog/$1 break; + proxy_pass http://consulbackend; + } + + location /api/health/v1 { + rewrite ^/api/health/v1/(.*) /v1/health/$1 break; + proxy_pass http://consulbackend; + } + + location /api/health_check/v1 { + rewrite /api/health_check/v1 /v1/status/leader break; + proxy_pass http://consulbackend; + } + + location = /favicon.ico { + log_not_found off; + } + + location = /msb { + return 302 $scheme://$http_host/iui/microservices/index.html; + } + + location / { + return 502 ; + } +}
\ No newline at end of file |