首页 > 解决方案 > Keycloak 登录和注册操作不是 https

问题描述

我有 nginx 可以处理 https,但是 keycloak 的登录和注册表单有 http 操作,我找不到将它们设置为 https 的方法。

在浏览器中将它们设置为 https 可以正常工作。

有两个变量:

{url.registrationUrl}
{url.loginAction}

这些价值观从何而来?

编辑:

我做了一个解决方法

{url.registrationUrl?replace('http', 'https')}

标签: httpsloginregistrationkeycloak

解决方案


使用代理地址转发。

  1. 转发 Nginx (server.conf) 中的原始模式 proxy_set_header X-Forwarded-Proto $scheme;
  2. 在 http-listener 中的 Keyclok (standalone/domain.xml) proxy-address-forwarding=true 中使用此信息

https://www.keycloak.org/docs/latest/server_installation/index.html#identifying-client-ip-addresses


推荐阅读