Ocelot代理各个软件错误解决
代理identity
{ "DownstreamPathTemplate": "/{url}", "DownstreamScheme": "https",//这里更改就行 "DownstreamHostAndPorts": [ { "Host": "localhost", "Port": 7128 } ], "UpstreamPathTemplate": "/auth/{url}", "UpstreamHttpMethod": [ "Get", "Post" ], "LoadBalancerOptions": { "Type": "RoundRobin" } }

下图为里ocelot里 http和https 用错了,检查下,

下图代理 identity ,原因是 端口写错了,还有host,host.docker.internal 本地可以,到ubuntu服务器会有问题,填写IP OK

代理swagger,
更改 ocelot 配置里改为https,我最初为http,弄了很久操蛋
{
"DownstreamPathTemplate": "/swagger/v1/swagger.json",
"DownstreamScheme": "http",//这里要https
"UpstreamPathTemplate": "/product/swagger/v1/swagger.json",
"UpstreamHttpMethod": [ "Get" ],
"ServiceName": "ProductService",
"LoadBalancerOptions": {
"Type": "RoundRobin"
}
},
{
"DownstreamPathTemplate": "/swagger/v1/swagger.json",
"DownstreamScheme": "https",
"UpstreamPathTemplate": "/order/swagger/v1/swagger.json",
"UpstreamHttpMethod": [ "Get" ],
"ServiceName": "OrderService",
"LoadBalancerOptions": {
"Type": "RoundRobin"
}
},


浙公网安备 33010602011771号