From afb73976369bea83106ceddc08dabb0e4ea7b5c5 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Thu, 20 Dec 2012 18:06:11 +0100 Subject: o Upgrading to 8.1.8. o Setting the "forwarded" flag on the connector to true so that it'll use any info from mod_proxy when the app requests the remote address. --- src/main/java/io/trygvis/appsh/booter/jetty/JettyWebServer.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/main/java/io/trygvis/appsh/booter/jetty/JettyWebServer.java b/src/main/java/io/trygvis/appsh/booter/jetty/JettyWebServer.java index 9ee8e24..4783150 100644 --- a/src/main/java/io/trygvis/appsh/booter/jetty/JettyWebServer.java +++ b/src/main/java/io/trygvis/appsh/booter/jetty/JettyWebServer.java @@ -1,6 +1,5 @@ package io.trygvis.appsh.booter.jetty; -import org.eclipse.jetty.server.Connector; import org.eclipse.jetty.server.Server; import org.eclipse.jetty.server.handler.ContextHandler; import org.eclipse.jetty.server.handler.ContextHandlerCollection; @@ -53,8 +52,13 @@ public class JettyWebServer { Server server = new Server(); if (httpPort != 0) { - Connector connector = new SelectChannelConnector(); + SelectChannelConnector connector = new SelectChannelConnector(); connector.setPort(httpPort); + + // http://docs.codehaus.org/display/JETTY/Configuring+Connectors - Look for "forwarded" + // http://docs.codehaus.org/display/JETTY/Configuring+mod_proxy + // http://httpd.apache.org/docs/2.2/mod/mod_proxy.html#x-headers + connector.setForwarded(true); server.addConnector(connector); } -- cgit v1.2.3