aboutsummaryrefslogtreecommitdiffstats
path: root/nginx-ext-consul/src/assembly/resources/nginx/sites-enabled/openresty-consul.conf
blob: f4f19ab975c4a5bbad50231b4dab125434ecf47b (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
#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 ;
   } 
}