Discovery supports blocking monitoring time exceeding 10min
[msb/discovery.git] / nginx-ext-consul / src / assembly / resources / nginx / sites-enabled / openresty-consul.conf
1 #set conf for proxy pass
2 proxy_connect_timeout 15s;
3 proxy_read_timeout 660s;
4 proxy_send_timeout 120s;
5 proxy_set_header X-Real-IP $remote_addr;
6 proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
7 proxy_set_header Host $host:$server_port;
8 proxy_http_version 1.1;
9 proxy_set_header Connection "";
10
11 upstream apibackend {
12     server 127.0.0.1:8076;
13         keepalive 200;
14 }
15 upstream consulbackend {
16     server 127.0.0.1:8500;
17         keepalive 200;
18 }
19
20
21 server {
22    listen 10081;
23    
24    location /api/microservices/v1 {
25                 proxy_pass http://apibackend;
26    } 
27    location /iui/microservices {
28                 root html ;
29    } 
30    
31    location /admin/metrics {
32                 proxy_pass http://apibackend;
33    }
34    
35    location /api/msdiscover/v1 {
36         rewrite ^/api/msdiscover/v1/(.*) /api/microservices/v1/$1 break;
37                 proxy_pass http://apibackend;
38    } 
39    
40    location /api/catalog/v1 {
41         rewrite ^/api/catalog/v1/(.*) /v1/catalog/$1 break;
42                 proxy_pass http://consulbackend;
43    } 
44    
45    location /api/health/v1 {
46         rewrite ^/api/health/v1/(.*) /v1/health/$1 break;
47                 proxy_pass http://consulbackend;
48    }
49
50    location /api/health_check/v1 {
51         rewrite /api/health_check/v1 /v1/status/leader break;
52         proxy_pass http://consulbackend;
53    }      
54
55    location = /favicon.ico {
56         log_not_found off;
57    }
58
59    location = /msb {
60       return 302 $scheme://$http_host/iui/microservices/index.html;
61    }   
62
63    location  / {                                                    
64       return 502 ;
65    } 
66 }