Identityserver4 openid-configuration省略运行nginx反向代理的主机端口

时间:2018-09-28 12:59:25

标签: docker nginx asp.net-core-2.0 identityserver4

我正在Windows中使用docker在Nginx反向代理后面设置Identity Server4。它在myhost:5000上正常运行。但是访问http://myhost:5000/.well-known/openid-configuration时收到以下响应 缺少端口号但在开发环境中有效的端口(即:http://localhost:5000

{
"issuer":"http://myhost",
"jwks_uri":"http://myhost/.well-known/openid-configuration/jwks",
"authorization_endpoint":"http://myhost/connect/authorize",
"token_endpoint":"http://myhost/connect/token",
"userinfo_endpoint":"http://myhost/connect/userinfo",
"end_session_endpoint":"http://myhost/connect/endsession",
"check_session_iframe":"http://myhost/connect/checksession",
"revocation_endpoint":"http://myhost/connect/revocation",
"introspection_endpoint":"http://myhost/connect/introspect",
"frontchannel_logout_supported":true,
"frontchannel_logout_session_supported":true,
"backchannel_logout_supported":true,
"backchannel_logout_session_supported":true,    
}

我尝试遵循身份服务器选项 IssuerUri PublicOrigin ,但是响应保持不变。

还有其他解决方案来获取带有端口号的响应吗?

谢谢

1 个答案:

答案 0 :(得分:0)

我也正面临这个问题。
您需要在nginx的Host标头中添加端口。
proxy_set_header Host $host:$server_port;

Original Source