Use case: Due to specific restrictions, I need to configure the following configuration:
The Tomcat application will be accessed using the IIS proxy: https://server/myapp
The Keycloak authentication will be accessed using directly the keycloak URL: https://server:8443/auth/....
Problem: When I access keycloak directly using the 8443 secured port works great, but when I access the Java application via IIS proxy (443), the IIS/Tomcat is redirecting for the keycloak authentication to port 443 instead of port 8443.
Question: Are there any settings on IIS, Tomcat, or Keycloak that I am missing to make the tomcat redirect to the correct keycloak 8443 port for authentication?
Ie: When adding to the browser the https://server/myapp URL, the tomcat application is redirecting (for authentication) to https://server/auth/ instead of https://server:8443/auth/
IIS ARR configuration screenshot: IIS ARR settings
IIS Redirect rule configuration screenshot IIS Redirect rule
Deployment use-case screenshot Deployment use case diagram
but when I access the Java application via IIS proxy (443), the IIS/Tomcat is redirecting for the keycloak authentication to port 443 instead of port 8443.
Where is the request coming from to the Java Application and where is it going to. If you are going to the domain name, it’s going to hit your IIS proxy first on 443.
Try adding an 8443 rewrite rule for keycloak in IIS