File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -41,7 +41,9 @@ server {
4141 }
4242
4343 location /api/order {
44- proxy_pass http ://order-service:3000 /;
44+ rewrite ^/api/order$ / break ;
45+ rewrite ^/api/order( /.*) $ $1 break ;
46+ proxy_pass http ://order-service:3000 ;
4547 proxy_http_version 1.1;
4648 }
4749
@@ -51,7 +53,9 @@ server {
5153 }
5254
5355 location /api/products {
54- proxy_pass http ://product-service:3002 /;
56+ rewrite ^/api/products$ / break ;
57+ rewrite ^/api/products( /.*) $ $1 break ;
58+ proxy_pass http ://product-service:3002 ;
5559 proxy_http_version 1.1;
5660 }
5761
@@ -71,7 +75,9 @@ server {
7175 # }
7276
7377 location /api/product {
74- proxy_pass http ://product-service:3002 /;
78+ rewrite ^/api/product$ / break ;
79+ rewrite ^/api/product( /.*) $ $1 break ;
80+ proxy_pass http ://product-service:3002 ;
7581 proxy_http_version 1.1;
7682 }
7783
Original file line number Diff line number Diff line change @@ -26,12 +26,16 @@ server {
2626 }
2727
2828 location /api/orders {
29- proxy_pass http ://order-service:3000 /;
29+ rewrite ^/api/orders$ / break ;
30+ rewrite ^/api/orders( /.*) $ $1 break ;
31+ proxy_pass http ://order-service:3000 ;
3032 proxy_http_version 1.1;
3133 }
3234
3335 location /api/products {
34- proxy_pass http ://product-service:3002 /;
36+ rewrite ^/api/products$ / break ;
37+ rewrite ^/api/products( /.*) $ $1 break ;
38+ proxy_pass http ://product-service:3002 ;
3539 proxy_http_version 1.1;
3640 }
3741}
You can’t perform that action at this time.
0 commit comments