headers for all requests
Content-Type : application/json
1.1 set upstream name
http post
http://
<GATEWAY_IP>
:8001/upstreams
body
{
"name" : "oauth.v1.service"
}
1.2 set target servers under upstream http post
http://
<GATEWAY_IP>
:8001/upstreams/oauth.v1.service
/targets
body
target server 1
{
"target" : "10.130.50.115:30001",
"weight" : 50
}
target server 2
{
"target" : "10.130.12.164:30001",
"weight" : 50
}
http post
http://
<GATEWAY_IP>
:8001/services
body
{
"name" : "oauth-service",
"host" : "oauth.v1.service",
"path" : "/"
}
http post
http://
<GATEWAY_IP>
:8001/services/oauth-service
/routes
body
{
"hosts" : ["auth.mydomainname.com"],
"paths" : ["/oauth/v1"]
}
https://auth.mydomainname.com
/oauth/v1