我已经阅读了发布说明https://steeltoe.io/reference/reference-release-notes/#2-2-0并有兴趣通过 http 公开 /health 端点(我的意思是在 PCF 应用程序管理器之外)。我在 appsettings.json 中有以下设置
{
"management": {
"endpoints": {
"path": "/cloudfoundryapplication",
"cloudfoundry": {
"validateCertificates": false
},
"health": {
"showdetails": "always",
"claim": {
"type": "health_actuator",
"value": "see_details"
}
}
}
}
}
我的项目参考了 Steeltoe.Management.CloudFoundryCore V2.2.0,我的启动如下所示
public void ConfigureServices(IServiceCollection services)
{
// Add health actuator
services.AddHealthActuator(configuration);
services.AddCloudFoundryActuators(Configuration);
}
public void Configure(IApplicationBuilder app)
{
if (HostingEnvironment.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
app.UseCloudFoundryActuators();
app.UseHealthChecks();
app.UseMvc();
}
现在,当我尝试调用 url https://myservice/cloudfoundryapplication/health时,我收到一个 401 错误,提示 {"security_error":"Authorization header is missing or invalid"}。知道这里可能有什么问题。