A reverse proxy like IIS can sit between clients and keycloak server and forwards the client requests to keycloak
This setup can deligate common web server features like SSL, web server hardening etc to the reverse proxy
Keycloak “edge” mode
edge mode or SSL termination mode in Keycloak configures Keycloak to use X-Forwarded headers from HTTP request to figure out the client’s original request information
IIS modules
Install AAR and URL rewrite modules in IIS
Website in IIS for reverse proxy
Create a website in IIS and bind to a port (say 443)
Enable HTTP in the website (recommended)
URL rewrite rule
Open the website in IIS and double click url-rewrite module
Create a rule as shown below which to make the website act as a reverse proxy for keycloak server which is running at http://192.168.10.11:8085
Note that HTTP_X_FORWARDED_PROTO, HTTP_X_FORWARDED_PORT, HTTP_X_FORWARDED_HOST, HTTP_X_FORWARDED_FOR server variables are set in the wrl rewrite rule. This helps keycloak to detect that the request is routed through reverse proxy and the original request details received by the reverse proxy.
IIS web config for reverse proxy site
Instead of graphically configuring url rewrite rule, the rule can also be added to the site’s web.config as shown below
Comments
Post a Comment