Configure reverse-proxy for Keycloak docker with custom base URL

前端 未结 5 2066
情话喂你
情话喂你 2020-12-13 00:54

How can I set the docker keycloak base url as parameter ?

I have the following nginx reverse proxy configuration:

server {
    listen 80         


        
5条回答
  •  情深已故
    2020-12-13 01:13

    The redirekt from "/keycloak" to "/keycloak/auth" isnt working. The Redirekt Route in index.html and Base-URL is missing the "/keycloak" part. I had to add this:

    FROM jboss/keycloak:latest
    
    USER jboss
    
    RUN sed -i -e 's/auth<\/web-context>/keycloak\/auth<\/web-context>/' $JBOSS_HOME/standalone/configuration/standalone.xml
    RUN sed -i -e 's/auth<\/web-context>/keycloak\/auth<\/web-context>/' $JBOSS_HOME/standalone/configuration/standalone-ha.xml
    RUN sed -i -e 's/name="\/"/name="\/keycloak\/"/' $JBOSS_HOME/standalone/configuration/standalone.xml
    RUN sed -i -e 's/name="\/"/name="\/keycloak\/"/' $JBOSS_HOME/standalone/configuration/standalone-ha.xml
    RUN sed -i -e 's/\/auth/\/keycloak\/auth"/' $JBOSS_HOME/welcome-content/index.html
    

提交回复
热议问题