2017-04-13 96 views
0

我试图让IdentityServer 4在双节点ARR设置中运行。我配置了其他双节点Web应用程序,但IdentityServer不想玩得很好。服务器仅设置为HTTPS。当我在一个站点中使用它时,一切正常,并且所有请求都是https:// ...但是在ARR设置中,请求的启动方式如下:身份服务器4与ARR(应用程序请求路由)

https://identityserver.local/.well-known/openid-configuration http:/identityserver.local/connect/authorize? CLIENT_ID = ....

第二请求导致404。当我有它作为常规的单中心,即第二请求是:

HTTPS:?/identityserver.local/connect/authorize CLIENT_ID = ....

为什么在使用ARR运行时,它代替https而不是https?

回答

1

为这一个两步骤的溶液: 首先我固定转发标头:

services.Configure<ForwardedHeadersOptions>(options => 
{ 
    options.ForwardedHeaders = ForwardedHeaders.XForwardedProto; 
}); 

接下来,配置数据保护,使得加密密钥由该应用的不同实例共享。

services.AddDataProtection() 
     .SetApplicationName("MyAspNetCoreSample") 
     .PersistKeysToFileSystem(new DirectoryInfo(@"path\to\shared\folder")); 

希望这可以帮助别人。

相关问题