系统相关
首页 > 系统相关> > Keycloak使用nginx配置https

Keycloak使用nginx配置https

作者:互联网

Keycloak使用nginx配置https

nginx server中需包含如下配置

proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto $the_scheme;

修改standalone.xml

在http-listener中添加proxy-address-forwarding
在http-listener中添加redirect-socket

<subsystem xmlns="urn:jboss:domain:undertow:10.0" default-server="default-server" default-virtual-host="default-host" default-servlet-container="default" default-security-domain="other" statistics-enabled="${wildfly.undertow.statistics-enabled:${wildfly.statistics-enabled:false}}">
            <buffer-cache name="default"/>
            <server name="default-server">
                <http-listener name="default" socket-binding="http" proxy-address-forwarding="true" redirect-socket="proxy-https"/>
                <https-listener name="https" socket-binding="https" security-realm="ApplicationRealm" enable-http2="true"/>
                ...
            </server>
</subsystem>

标签:xml,set,Forwarded,header,nginx,proxy,https,Keycloak
来源: https://blog.csdn.net/wangtian2014/article/details/104861818