Ocelot配置
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
}
},
"AllowedHosts": "*",
"Routes": [
{
//上游Api请求格式
"UpstreamPathTemplate": "/api/customer/{controller}/{action}",
//网关转发到下游格式
"DownstreamPathTemplate": "/api/customer/{controller}/{action}",
//上下游支持请求方法
"UpstreamHttpMethod": [ "GET", "POST", "DELETE", "PUT" ],
"DownstreamScheme": "http",
//下游服务配置
"DownstreamHostAndPorts": [
{
//下游地址
"Host": "localhost",
//下游端口号
"Port": 9001
}
]
}
]
}