diff --git a/core/src/main/java/org/keycloak/util/UriUtils.java b/core/src/main/java/org/keycloak/util/UriUtils.java
index 8532c5b630..3f0f9afa62 100644
--- a/core/src/main/java/org/keycloak/util/UriUtils.java
+++ b/core/src/main/java/org/keycloak/util/UriUtils.java
@@ -8,7 +8,7 @@ import java.util.regex.Pattern;
*/
public class UriUtils {
- private static final Pattern originPattern = Pattern.compile("(http://|https://)[\\w]+(\\.[\\w]+)*(:[\\d]{2,5})?");
+ private static final Pattern originPattern = Pattern.compile("(http://|https://)[\\w-]+(\\.[\\w-]+)*(:[\\d]{2,5})?");
public static String getOrigin(URI uri) {
return getOrigin(uri.toString());
diff --git a/core/src/test/java/org/keycloak/util/UriUtilsTest.java b/core/src/test/java/org/keycloak/util/UriUtilsTest.java
index 52d484ded8..af89777dfb 100644
--- a/core/src/test/java/org/keycloak/util/UriUtilsTest.java
+++ b/core/src/test/java/org/keycloak/util/UriUtilsTest.java
@@ -24,6 +24,8 @@ public class UriUtilsTest {
assertValid("http://192.168.123.123");
assertValid("https://192.168.123.123");
assertValid("https://192.168.123.123:8080");
+ assertValid("https://sub-sub.test.com");
+ assertValid("https://sub.test-test.com");
assertInvalid("https://test/");
assertInvalid("{");
diff --git a/docbook/reference/en/en-US/modules/server-installation.xml b/docbook/reference/en/en-US/modules/server-installation.xml
index 9e595a194d..5ca0cd8f50 100755
--- a/docbook/reference/en/en-US/modules/server-installation.xml
+++ b/docbook/reference/en/en-US/modules/server-installation.xml
@@ -625,29 +625,74 @@ keycloak-war-dist-all-&project.version;/
X-Forwarded-Proto headers on the requests made to Keycloak. Next you need to enable
proxy-address-forwarding on the Keycloak http connector. Assuming that your reverse
proxy doesn't use port 8443 for SSL you also need to configure what port http traffic is redirected to.
- This is done by editing standalone/configuration/standalone.xml.
- First add proxy-address-forwarding and redirect-socket to the http-listener
- element:
-
+
+
+ WildFly
+
+
+ Open standalone/configuration/standalone.xml in your favorite editor.
+
+
+
+ First add proxy-address-forwarding and redirect-socket to
+ the http-listener element:
...
-
+
...
]]>
- Then add a new socket-binding element to the socket-binding-group element:
+
+
+ Then add a new socket-binding element to the socket-binding-group element:
+
...
...
]]>
-
-
- Check the WildFly documentation for more information.
-
+
+
+ Check the WildFly documentation for more information.
+
+
+
+
+ AS7/EAP
+
+
+ Open standalone/configuration/standalone.xml in your favorite editor.
+
+
+
+ You need to add redirect-port to http connector element and
+ add the RemoteIpValve valve:
+
+
+
+
+
+
+
+
+
+
+]]>
+
+
+
+
+
+