Keycloak behind apache reverse proxy

后端 未结 5 1205
春和景丽
春和景丽 2020-12-24 09:38

I have surfed through google without finding any concrete answers or examples, so again trying my luck here (often get lucky).

5条回答
  •  北荒
    北荒 (楼主)
    2020-12-24 10:18

    You need to inform keycloak about the location of the reverse proxy. Then in its response it will set location to there instead of its local address. To do that in the latest keycloak set the environment variable 'KEYCLOAK_FRONTEND_URL' to point to the string https://example.com/auth (yes, it needs the whole address. To make this work, also set PROXY_ADDRESS_FORWARDING to the value true

    If it's a Docker container, that means:

    environment:
      ...
      PROXY_ADDRESS_FORWARDING: "true"
      KEYCLOAK_FRONTEND_URL: "https://example.com/auth"
    

    Alternately, you can set KEYCLOAK_HOSTNAME to example.com and that will leave the port number, for which???(not sure how to do this part yet, if you find out please let me know... ) )

提交回复
热议问题