mirror of
https://github.com/nsnail/Ocelot.git
synced 2025-04-22 23:22:51 +08:00

* #451 started implementing querystring support in templates * #451 ocelot.json back to normal and specified in docs query string wont work in upstream template * Revert "#451 ocelot.json back to normal and specified in docs query string wont work in upstream template" This reverts commit 563193f7b2f78bad6109484fe77f3c87de831005. * #451 ocelot.json back to normal and specified in docs query string wont work in upstream template
346 lines
9.8 KiB
JSON
346 lines
9.8 KiB
JSON
{
|
|
"ReRoutes": [
|
|
{
|
|
"DownstreamPathTemplate": "/profile",
|
|
"DownstreamScheme": "http",
|
|
"UpstreamPathTemplate": "/profile",
|
|
"UpstreamHttpMethod": [ "Get" ],
|
|
"DownstreamHostAndPorts": [
|
|
{
|
|
"Host": "localhost",
|
|
"Port": 3000
|
|
}
|
|
],
|
|
"QoSOptions": {
|
|
"TimeoutValue": 360000
|
|
}
|
|
},
|
|
{
|
|
"DownstreamPathTemplate": "/api/v1/todo/",
|
|
"DownstreamScheme": "http",
|
|
"UpstreamPathTemplate": "/api/v1/todo/",
|
|
"UpstreamHttpMethod": [ "Get", "Post" ],
|
|
"DownstreamHostAndPorts": [
|
|
{
|
|
"Host": "lxtodo.azurewebsites.net",
|
|
"Port": 80
|
|
}
|
|
|
|
],
|
|
"DownstreamHeaderTransform": {
|
|
"Location": "{DownstreamBaseUrl}, {BaseUrl}"
|
|
}
|
|
},
|
|
{
|
|
"DownstreamPathTemplate": "/api/values",
|
|
"DownstreamScheme": "https",
|
|
"UpstreamPathTemplate": "/api/values",
|
|
"UpstreamHttpMethod": [ "Get" ],
|
|
"DownstreamHostAndPorts": [
|
|
{
|
|
"Host": "testapivalues.azurewebsites.net",
|
|
"Port": 443
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"DownstreamPathTemplate": "/",
|
|
"DownstreamScheme": "http",
|
|
"DownstreamHostAndPorts": [
|
|
{
|
|
"Host": "localhost",
|
|
"Port": 52876
|
|
}
|
|
],
|
|
"UpstreamPathTemplate": "/identityserverexample",
|
|
"UpstreamHttpMethod": [ "Get" ],
|
|
"QoSOptions": {
|
|
"ExceptionsAllowedBeforeBreaking": 3,
|
|
"DurationOfBreak": 10,
|
|
"TimeoutValue": 5000
|
|
},
|
|
"AuthenticationOptions": {
|
|
"AuthenticationProviderKey": "TestKey",
|
|
"AllowedScopes": [
|
|
"openid",
|
|
"offline_access"
|
|
]
|
|
},
|
|
"AddHeadersToRequest": {
|
|
"CustomerId": "Claims[CustomerId] > value",
|
|
"LocationId": "Claims[LocationId] > value",
|
|
"UserType": "Claims[sub] > value[0] > |",
|
|
"UserId": "Claims[sub] > value[1] > |"
|
|
},
|
|
"AddClaimsToRequest": {
|
|
"CustomerId": "Claims[CustomerId] > value",
|
|
"LocationId": "Claims[LocationId] > value",
|
|
"UserType": "Claims[sub] > value[0] > |",
|
|
"UserId": "Claims[sub] > value[1] > |"
|
|
},
|
|
"AddQueriesToRequest": {
|
|
"CustomerId": "Claims[CustomerId] > value",
|
|
"LocationId": "Claims[LocationId] > value",
|
|
"UserType": "Claims[sub] > value[0] > |",
|
|
"UserId": "Claims[sub] > value[1] > |"
|
|
},
|
|
"RouteClaimsRequirement": {
|
|
"UserType": "registered"
|
|
},
|
|
"RequestIdKey": "OcRequestId"
|
|
},
|
|
{
|
|
"DownstreamPathTemplate": "/posts",
|
|
"DownstreamScheme": "https",
|
|
"DownstreamHostAndPorts": [
|
|
{
|
|
"Host": "jsonplaceholder.typicode.com",
|
|
"Port": 443
|
|
}
|
|
],
|
|
"UpstreamPathTemplate": "/posts",
|
|
"UpstreamHttpMethod": [ "Get" ],
|
|
"HttpHandlerOptions": {
|
|
"AllowAutoRedirect": true,
|
|
"UseCookieContainer": true
|
|
},
|
|
"QoSOptions": {
|
|
"ExceptionsAllowedBeforeBreaking": 3,
|
|
"DurationOfBreak": 10,
|
|
"TimeoutValue": 5000
|
|
}
|
|
},
|
|
{
|
|
"DownstreamPathTemplate": "/posts/{postId}",
|
|
"DownstreamScheme": "http",
|
|
"DownstreamHostAndPorts": [
|
|
{
|
|
"Host": "jsonplaceholder.typicode.com",
|
|
"Port": 80
|
|
}
|
|
],
|
|
"UpstreamPathTemplate": "/posts/{postId}",
|
|
"UpstreamHttpMethod": [ "Get" ],
|
|
"RequestIdKey": "ReRouteRequestId",
|
|
"HttpHandlerOptions": {
|
|
"AllowAutoRedirect": true,
|
|
"UseCookieContainer": true,
|
|
"UseTracing": true,
|
|
"UseProxy": true
|
|
},
|
|
"QoSOptions": {
|
|
"ExceptionsAllowedBeforeBreaking": 3,
|
|
"DurationOfBreak": 10,
|
|
"TimeoutValue": 5000
|
|
}
|
|
},
|
|
{
|
|
"DownstreamPathTemplate": "/posts/{postId}/comments",
|
|
"DownstreamScheme": "http",
|
|
"DownstreamHostAndPorts": [
|
|
{
|
|
"Host": "jsonplaceholder.typicode.com",
|
|
"Port": 80
|
|
}
|
|
],
|
|
"UpstreamPathTemplate": "/posts/{postId}/comments",
|
|
"UpstreamHttpMethod": [ "Get" ],
|
|
"HttpHandlerOptions": {
|
|
"AllowAutoRedirect": true,
|
|
"UseCookieContainer": true,
|
|
"UseTracing": false
|
|
},
|
|
"QoSOptions": {
|
|
"ExceptionsAllowedBeforeBreaking": 3,
|
|
"DurationOfBreak": 10,
|
|
"TimeoutValue": 5000
|
|
}
|
|
},
|
|
{
|
|
"DownstreamPathTemplate": "/comments",
|
|
"DownstreamScheme": "http",
|
|
"DownstreamHostAndPorts": [
|
|
{
|
|
"Host": "jsonplaceholder.typicode.com",
|
|
"Port": 80
|
|
}
|
|
],
|
|
"UpstreamPathTemplate": "/comments",
|
|
"UpstreamHttpMethod": [ "Get" ],
|
|
"QoSOptions": {
|
|
"ExceptionsAllowedBeforeBreaking": 3,
|
|
"DurationOfBreak": 10,
|
|
"TimeoutValue": 5000
|
|
}
|
|
},
|
|
{
|
|
"DownstreamPathTemplate": "/posts",
|
|
"DownstreamScheme": "http",
|
|
"DownstreamHostAndPorts": [
|
|
{
|
|
"Host": "jsonplaceholder.typicode.com",
|
|
"Port": 80
|
|
}
|
|
],
|
|
"UpstreamPathTemplate": "/posts",
|
|
"UpstreamHttpMethod": [ "Post" ],
|
|
"QoSOptions": {
|
|
"ExceptionsAllowedBeforeBreaking": 3,
|
|
"DurationOfBreak": 10,
|
|
"TimeoutValue": 5000
|
|
}
|
|
},
|
|
{
|
|
"DownstreamPathTemplate": "/posts/{postId}",
|
|
"DownstreamScheme": "http",
|
|
"DownstreamHostAndPorts": [
|
|
{
|
|
"Host": "jsonplaceholder.typicode.com",
|
|
"Port": 80
|
|
}
|
|
],
|
|
"UpstreamPathTemplate": "/posts/{postId}",
|
|
"UpstreamHttpMethod": [ "Put" ],
|
|
"QoSOptions": {
|
|
"ExceptionsAllowedBeforeBreaking": 3,
|
|
"DurationOfBreak": 10,
|
|
"TimeoutValue": 5000
|
|
}
|
|
},
|
|
{
|
|
"DownstreamPathTemplate": "/posts/{postId}",
|
|
"DownstreamScheme": "http",
|
|
"DownstreamHostAndPorts": [
|
|
{
|
|
"Host": "jsonplaceholder.typicode.com",
|
|
"Port": 80
|
|
}
|
|
],
|
|
"UpstreamPathTemplate": "/posts/{postId}",
|
|
"UpstreamHttpMethod": [ "Patch" ],
|
|
"QoSOptions": {
|
|
"ExceptionsAllowedBeforeBreaking": 3,
|
|
"DurationOfBreak": 10,
|
|
"TimeoutValue": 5000
|
|
}
|
|
},
|
|
{
|
|
"DownstreamPathTemplate": "/posts/{postId}",
|
|
"DownstreamScheme": "http",
|
|
"DownstreamHostAndPorts": [
|
|
{
|
|
"Host": "jsonplaceholder.typicode.com",
|
|
"Port": 80
|
|
}
|
|
],
|
|
"UpstreamPathTemplate": "/posts/{postId}",
|
|
"UpstreamHttpMethod": [ "Delete" ],
|
|
"QoSOptions": {
|
|
"ExceptionsAllowedBeforeBreaking": 3,
|
|
"DurationOfBreak": 10,
|
|
"TimeoutValue": 5000
|
|
}
|
|
},
|
|
{
|
|
"DownstreamPathTemplate": "/api/products",
|
|
"DownstreamScheme": "http",
|
|
"DownstreamHostAndPorts": [
|
|
{
|
|
"Host": "jsonplaceholder.typicode.com",
|
|
"Port": 80
|
|
}
|
|
],
|
|
"UpstreamPathTemplate": "/products",
|
|
"UpstreamHttpMethod": [ "Get" ],
|
|
"QoSOptions": {
|
|
"ExceptionsAllowedBeforeBreaking": 3,
|
|
"DurationOfBreak": 10,
|
|
"TimeoutValue": 5000
|
|
},
|
|
"FileCacheOptions": { "TtlSeconds": 15 }
|
|
},
|
|
{
|
|
"DownstreamPathTemplate": "/api/products/{productId}",
|
|
"DownstreamScheme": "http",
|
|
"DownstreamHostAndPorts": [
|
|
{
|
|
"Host": "jsonplaceholder.typicode.com",
|
|
"Port": 80
|
|
}
|
|
],
|
|
"UpstreamPathTemplate": "/products/{productId}",
|
|
"UpstreamHttpMethod": [ "Get" ],
|
|
"FileCacheOptions": { "TtlSeconds": 15 }
|
|
},
|
|
{
|
|
"DownstreamPathTemplate": "/api/products",
|
|
"DownstreamScheme": "http",
|
|
"DownstreamHostAndPorts": [
|
|
{
|
|
"Host": "jsonplaceholder.typicode.com",
|
|
"Port": 80
|
|
}
|
|
],
|
|
"UpstreamPathTemplate": "/products",
|
|
"UpstreamHttpMethod": [ "Post" ],
|
|
"QoSOptions": {
|
|
"ExceptionsAllowedBeforeBreaking": 3,
|
|
"DurationOfBreak": 10,
|
|
"TimeoutValue": 5000
|
|
}
|
|
},
|
|
{
|
|
"DownstreamPathTemplate": "/api/products/{productId}",
|
|
"DownstreamScheme": "http",
|
|
"DownstreamHostAndPorts": [
|
|
{
|
|
"Host": "jsonplaceholder.typicode.com",
|
|
"Port": 80
|
|
}
|
|
],
|
|
"UpstreamPathTemplate": "/products/{productId}",
|
|
"UpstreamHttpMethod": [ "Put" ],
|
|
"QoSOptions": {
|
|
"ExceptionsAllowedBeforeBreaking": 3,
|
|
"DurationOfBreak": 10,
|
|
"TimeoutValue": 5000
|
|
},
|
|
"FileCacheOptions": { "TtlSeconds": 15 }
|
|
},
|
|
{
|
|
"DownstreamPathTemplate": "/posts",
|
|
"DownstreamScheme": "http",
|
|
"DownstreamHostAndPorts": [
|
|
{
|
|
"Host": "jsonplaceholder.typicode.com",
|
|
"Port": 80
|
|
}
|
|
],
|
|
"UpstreamPathTemplate": "/posts/",
|
|
"UpstreamHttpMethod": [ "Get" ],
|
|
"QoSOptions": {
|
|
"ExceptionsAllowedBeforeBreaking": 3,
|
|
"DurationOfBreak": 10,
|
|
"TimeoutValue": 5000
|
|
},
|
|
"FileCacheOptions": { "TtlSeconds": 15 }
|
|
},
|
|
{
|
|
"DownstreamPathTemplate": "/",
|
|
"DownstreamScheme": "http",
|
|
"DownstreamHostAndPorts": [
|
|
{
|
|
"Host": "www.bbc.co.uk",
|
|
"Port": 80
|
|
}
|
|
],
|
|
"UpstreamPathTemplate": "/bbc/",
|
|
"UpstreamHttpMethod": [ "Get" ]
|
|
}
|
|
],
|
|
|
|
"GlobalConfiguration": {
|
|
"RequestIdKey": "ot-traceid"
|
|
}
|
|
}
|