1. Ruqirement
nginx accepts the request url uniformly and forwards it
http://172.16.51.91:9000/api/order/create/44010000
http://172.16.51.91:9000/api/order/create/44060000
目标:
http://172.15.10.13:9001/api/order/create
http://172.15.10.13:9002/api/order/create
2. nginx Settings
nginx accepts the request url uniformly and forwards it
http://172.16.51.91:9000/api/order/create/44010000
http://172.16.51.91:9000/api/order/create/44060000
目标:
http://172.15.10.13:9001/api/order/create
http://172.15.10.13:9002/api/order/create
2. nginx Settings
server {
listen 9000;
server_name 172.16.51.91;
location ~*(44010000)$ {
rewrite ^/(.*)/44010000$ http://172.15.10.13:9001/$1 permanent;
}
location ~*(44060000)$ {
rewrite ^/(.*)/44060000$ http://172.15.10.13:9002/$1 permanent;
}
}