Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Wilkins2015-10-08 19:21:15 -0400
committerJoakim Erdfelt2016-02-04 13:58:23 -0500
commit90efbe62c8b8580e6e864f59cdf9ea42c10c44fd (patch)
tree8eb987ef8946d9a21d9a37e7b9976d18abf1938c
parent06fa8370fb19df05fe4d95e3a4d859abeb7f9eae (diff)
downloadorg.eclipse.jetty.project-90efbe62c8b8580e6e864f59cdf9ea42c10c44fd.tar.gz
org.eclipse.jetty.project-90efbe62c8b8580e6e864f59cdf9ea42c10c44fd.tar.xz
org.eclipse.jetty.project-90efbe62c8b8580e6e864f59cdf9ea42c10c44fd.zip
487277 - Introduce http-forwarded module for X-Forwarded support
-rw-r--r--jetty-server/src/main/config/etc/jetty-http-forwarded.xml17
-rw-r--r--jetty-server/src/main/config/etc/jetty.xml5
-rw-r--r--jetty-server/src/main/config/modules/http-forwarded.mod20
-rw-r--r--jetty-server/src/main/config/modules/https.mod1
4 files changed, 38 insertions, 5 deletions
diff --git a/jetty-server/src/main/config/etc/jetty-http-forwarded.xml b/jetty-server/src/main/config/etc/jetty-http-forwarded.xml
new file mode 100644
index 0000000000..0aacbb2468
--- /dev/null
+++ b/jetty-server/src/main/config/etc/jetty-http-forwarded.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0"?>
+<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_3.dtd">
+<Configure id="httpConfig" class="org.eclipse.jetty.server.HttpConfiguration">
+ <Call name="addCustomizer">
+ <Arg>
+ <New class="org.eclipse.jetty.server.ForwardedRequestCustomizer">
+ <Set name="forwardedHostHeader"><Property name="jetty.httpConfig.forwardedHostHeader" default="X-Forwarded-Host"/></Set>
+ <Set name="forwardedServerHeader"><Property name="jetty.httpConfig.forwardedServerHeader" default="X-Forwarded-Server"/></Set>
+ <Set name="forwardedProtoHeader"><Property name="jetty.httpConfig.forwardedProtoHeader" default="X-Forwarded-Proto"/></Set>
+ <Set name="forwardedForHeader"><Property name="jetty.httpConfig.forwardedForHeader" default="X-Forwarded-For"/></Set>
+ <Set name="forwardedSslSessionIdHeader"><Property name="jetty.httpConfig.forwardedSslSessionIdHeader" /></Set>
+ <Set name="forwardedCipherSuiteHeader"><Property name="jetty.httpConfig.forwardedCipherSuiteHeader" /></Set>
+ </New>
+ </Arg>
+ </Call>
+</Configure>
+
diff --git a/jetty-server/src/main/config/etc/jetty.xml b/jetty-server/src/main/config/etc/jetty.xml
index 5412979cac..8e6d1a4ae5 100644
--- a/jetty-server/src/main/config/etc/jetty.xml
+++ b/jetty-server/src/main/config/etc/jetty.xml
@@ -89,11 +89,6 @@
<Set name="delayDispatchUntilContent"><Property name="jetty.httpConfig.delayDispatchUntilContent" deprecated="jetty.delayDispatchUntilContent" default="true"/></Set>
<Set name="maxErrorDispatches"><Property name="jetty.httpConfig.maxErrorDispatches" default="10"/></Set>
<Set name="blockingTimeout"><Property name="jetty.httpConfig.blockingTimeout" default="-1"/></Set>
- <!-- Uncomment to enable handling of X-Forwarded- style headers
- <Call name="addCustomizer">
- <Arg><New class="org.eclipse.jetty.server.ForwardedRequestCustomizer"/></Arg>
- </Call>
- -->
</New>
<!-- =========================================================== -->
diff --git a/jetty-server/src/main/config/modules/http-forwarded.mod b/jetty-server/src/main/config/modules/http-forwarded.mod
new file mode 100644
index 0000000000..0915eece9e
--- /dev/null
+++ b/jetty-server/src/main/config/modules/http-forwarded.mod
@@ -0,0 +1,20 @@
+#
+# Jetty HTTP Connector
+#
+
+[depend]
+http
+
+[xml]
+etc/jetty-http-forwarded.xml
+
+[ini-template]
+### ForwardedRequestCustomizer Configuration
+
+# jetty.httpConfig.forwardedHostHeader=X-Forwarded-Host
+# jetty.httpConfig.forwardedServerHeader=X-Forwarded-Server
+# jetty.httpConfig.forwardedProtoHeader=X-Forwarded-Proto
+# jetty.httpConfig.forwardedForHeader=X-Forwarded-For
+# jetty.httpConfig.forwardedSslSessionIdHeader=
+# jetty.httpConfig.forwardedCipherSuiteHeader=
+
diff --git a/jetty-server/src/main/config/modules/https.mod b/jetty-server/src/main/config/modules/https.mod
index 092e0d70c7..a48107982e 100644
--- a/jetty-server/src/main/config/modules/https.mod
+++ b/jetty-server/src/main/config/modules/https.mod
@@ -7,6 +7,7 @@ ssl
[optional]
http2
+http-forwarded
[xml]
etc/jetty-https.xml

Back to the top