-
SummaryIn our usage scenario, we will dynamically generate many temporary intranet service nodes as needed(like http://172.16.2.41:8888/api/, http://172.16.2.42:8888/api/, http://172.16.2.43:8888/api/...), and we need to uniformly generate a dynamic external network access address for them exp: config in nginx maybe like: upstream node_41 {
server 172.16.2.41:8888;
}
upstream node_42 {
server 172.16.2.42:8888;
}
upstream node_43 {
server 172.16.2.43:8888;
}
...
server {
listen 80;
server_name www.my-exp.com;
location /dynamically-nodes/41 {
proxy_pass http://node_41;
}
location /dynamically-nodes/42 {
proxy_pass http://node_42;
}
location /dynamically-nodes/43 {
proxy_pass http://node_43;
}
....
} my question is how can I create "route" with specific "upstream" or "target"? Kong version: 2.4 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Create a http -f :8001/services name=node-41 url=http://172.16.2.41:8888/
http -f :8001/services/node-41/routes name=node-41 paths[]=/dynamically-nodes/41 |
Beta Was this translation helpful? Give feedback.
Create a
service
(as a destination) and then attach aroute
to match incoming traffic to that destination: